feat: improve SEO, index /gallery and bump age
This commit is contained in:
10
app/utils/birthday.ts
Normal file
10
app/utils/birthday.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export const BIRTHDAY_DAY = 25;
|
||||
export const BIRTHDAY_MONTH = 4;
|
||||
export const BIRTHDAY_YEAR = 2002;
|
||||
|
||||
export const getAge = (now = new Date()) => {
|
||||
const hadBirthdayThisYear =
|
||||
now.getMonth() > BIRTHDAY_MONTH - 1 ||
|
||||
(now.getMonth() === BIRTHDAY_MONTH - 1 && now.getDate() >= BIRTHDAY_DAY);
|
||||
return now.getFullYear() - BIRTHDAY_YEAR - (hadBirthdayThisYear ? 0 : 1);
|
||||
};
|
||||
Reference in New Issue
Block a user