Skip to content

Commit

Permalink
Merge pull request #900 from GenSpectrum/add-2024
Browse files Browse the repository at this point in the history
feat: add 2024
  • Loading branch information
chaoran-chen authored Jan 3, 2024
2 parents 00c6be7 + 31df7e9 commit 0e36007
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';
}
}

1 comment on commit 0e36007

@vercel
Copy link

@vercel vercel bot commented on 0e36007 Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.