Skip to content

Commit

Permalink
🐛 fix winter break date not 0 indexed
Browse files Browse the repository at this point in the history
  • Loading branch information
FredrikMorstad committed Dec 3, 2023
1 parent 90b233d commit 4989986
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ const NoUpcomingEvents = () => {
const isWinterBreak = (today: Date): boolean => {
const year = today.getFullYear();
// winter break
const winterBreakStart = new Date(year, 12, 1);
const winterBreakEnd = new Date(year + 1, 1, 15);
// 0 index so winter break starts 01.12
const winterBreakStart = new Date(year, 11, 1);
const winterBreakEnd = new Date(year + 1, 0, 15);

return today >= winterBreakStart && today <= winterBreakEnd;
};
Expand Down

0 comments on commit 4989986

Please sign in to comment.