refactor(server/utils): add reusable ficmas utility functions

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2023-10-03 01:07:29 -04:00
parent 5dac1d6492
commit 6ae407c600
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

8
lib/server/ficmas.ts Normal file
View File

@ -0,0 +1,8 @@
export const submissionsOpen = () =>
new Date() < new Date(Date.parse(`Dec 24 ${new Date().getFullYear()}`)) &&
Date.now() > Date.parse(`Nov 1 ${new Date().getFullYear()}`);
export const ficsHidden = (d: number) =>
d < Date.parse(`Dec 25 ${new Date().getFullYear()}`);
export const status = () =>
Date.now() > Date.parse(`Oct 1 ${new Date().getFullYear()}`) &&
Date.now() < Date.parse(`Nov 30 ${new Date().getFullYear()}`);