Update dependencies and fix code issues
This commit is contained in:
@ -12,7 +12,31 @@ const formatter = ref({
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:dateValue'])
|
||||
|
||||
const customShortcuts = () => {
|
||||
return [
|
||||
{
|
||||
label: "Last 15 Days",
|
||||
atClick: () => {
|
||||
const date = new Date();
|
||||
return [new Date(date.setDate(date.getDate() + 1)), date];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Last Years",
|
||||
atClick: () => {
|
||||
const date = new Date();
|
||||
return [new Date(date.setFullYear(date.getFullYear() - 1)), new Date()];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Last 3 Years",
|
||||
atClick: () => {
|
||||
const date = new Date();
|
||||
return [new Date(date.setFullYear(date.getFullYear() - 3)), new Date()];
|
||||
},
|
||||
},
|
||||
];
|
||||
};
|
||||
watch(dateValue, (newValue) => {
|
||||
emit('update:dateValue', newValue)
|
||||
})
|
||||
@ -24,7 +48,7 @@ watch(dateValue, (newValue) => {
|
||||
v-model="dateValue"
|
||||
:formatter="formatter"
|
||||
separator=" s/d "
|
||||
:shortcuts="false"
|
||||
:shortcuts="customShortcuts"
|
||||
:auto-apply="false"
|
||||
as-single
|
||||
use-range
|
||||
|
Reference in New Issue
Block a user