Skip to content

Commit

Permalink
feat: add 2024
Browse files Browse the repository at this point in the history
Happy New Year!
  • Loading branch information
chaoran-chen committed Jan 3, 2024
1 parent 00c6be7 commit 31df7e9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/data/DateRangeSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const specialDateRanges = [
'Y2021',
'Y2022',
'Y2023',
'Y2024',
'Past2W',
'Past1M',
'Past2M',
Expand Down Expand Up @@ -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':
Expand Down Expand Up @@ -206,5 +212,7 @@ export function specialDateRangeToString(dateRange: SpecialDateRange): string {
return '2022';
case 'Y2023':
return '2023';
case 'Y2024':
return '2024';
}
}

0 comments on commit 31df7e9

Please sign in to comment.