From 31df7e9cd5c6c8cda6281efe75297ac99f9f7049 Mon Sep 17 00:00:00 2001 From: Chaoran Chen Date: Wed, 3 Jan 2024 18:50:25 +0100 Subject: [PATCH] feat: add 2024 Happy New Year! --- src/data/DateRangeSelector.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/data/DateRangeSelector.ts b/src/data/DateRangeSelector.ts index ffe03596..fec324f6 100644 --- a/src/data/DateRangeSelector.ts +++ b/src/data/DateRangeSelector.ts @@ -24,6 +24,7 @@ export const specialDateRanges = [ 'Y2021', 'Y2022', 'Y2023', + 'Y2024', 'Past2W', 'Past1M', 'Past2M', @@ -67,6 +68,11 @@ export class SpecialDateRangeSelector implements DateRangeSelector { dateFrom: globalDateCache.getDay('2023-01-02'), dateTo: globalDateCache.getDay('2023-12-31'), }; + case 'Y2024': + return { + dateFrom: globalDateCache.getDay('2024-01-01'), + dateTo: globalDateCache.getDay('2024-12-29'), + }; case 'Past2W': return { dateFrom: weeksAgo(2), dateTo: daysAgo(7) }; case 'Past1M': @@ -206,5 +212,7 @@ export function specialDateRangeToString(dateRange: SpecialDateRange): string { return '2022'; case 'Y2023': return '2023'; + case 'Y2024': + return '2024'; } }