aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Media/Anime/season.ts
blob: d0cd6c258c563e23021ff4f141806266cc994b47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
export const season = () => {
  if (new Date().getMonth() >= 0 && new Date().getMonth() <= 2)
    return 'WINTER' as 'WINTER' | 'SPRING' | 'SUMMER' | 'FALL';
  else if (new Date().getMonth() >= 3 && new Date().getMonth() <= 5)
    return 'SPRING' as 'WINTER' | 'SPRING' | 'SUMMER' | 'FALL';
  else if (new Date().getMonth() >= 6 && new Date().getMonth() <= 8)
    return 'SUMMER' as 'WINTER' | 'SPRING' | 'SUMMER' | 'FALL';
  else if (new Date().getMonth() >= 9 && new Date().getMonth() <= 11)
    return 'FALL' as 'WINTER' | 'SPRING' | 'SUMMER' | 'FALL';
  else return 'WINTER' as 'WINTER' | 'SPRING' | 'SUMMER' | 'FALL';
};