Skip to content

Commit

Permalink
Simplify date logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tumppi066 committed Dec 31, 2024
1 parent 042fdd3 commit 90c88c5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/csr_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ export default function CSRLayout({ children, }: Readonly<{ children: React.Reac
});
});

const isNewYear = ((new Date().getMonth() === 0 && new Date().getDate() === 1) || (new Date().getMonth() === 11 && new Date().getDate() === 31)) && areFireworksAllowed;
const isSnowing = (new Date().getMonth() >= 10 || new Date().getMonth() === 0) && isSnowAllowed;
const date = new Date();
const month = date.getMonth();
const day = date.getDate();
const isNewYear = ((month === 0 && day === 1) || (month === 11 && day === 31)) && areFireworksAllowed;
const isSnowing = (month >= 10 || month === 0) && isSnowAllowed;

useEffect(() => {
loadTranslations().then(() => {
Expand Down

0 comments on commit 90c88c5

Please sign in to comment.