diff --git a/app/components/pub/my-ui/nav-header/filter.vue b/app/components/pub/my-ui/nav-header/filter.vue index 01b1ab55..ab28620b 100644 --- a/app/components/pub/my-ui/nav-header/filter.vue +++ b/app/components/pub/my-ui/nav-header/filter.vue @@ -34,9 +34,18 @@ const df = new DateFormatter('en-US', { dateStyle: 'medium', }) +// Get current date +const today = new Date() +const todayCalendar = new CalendarDate(today.getFullYear(), today.getMonth() + 1, today.getDate()) + +// Get date 1 month ago +const oneMonthAgo = new Date(today) +oneMonthAgo.setMonth(today.getMonth() - 1) +const oneMonthAgoCalendar = new CalendarDate(oneMonthAgo.getFullYear(), oneMonthAgo.getMonth() + 1, oneMonthAgo.getDate()) + const value = ref({ - start: new CalendarDate(2022, 1, 20), - end: new CalendarDate(2022, 1, 20).add({ days: 20 }), + start: oneMonthAgoCalendar, + end: todayCalendar, }) as Ref function onFilterClick() {