Calculate Season For Given Date (astrological)

Date: 2019-01-24

    /**
     *  Noordelijk halfrond
     *  Lente: 21 maart t/m 20 juni
     *  Zomer: 21 juni t/m 20 september
     *  Herfst: 21 september t/m 20 december
     *  Winter: 21 december t/m 20 maart
     * @return Seasons
     */
    getCurrentSeasonForDate(datetime : Date) {
        const month = datetime.getMonth() + 1;
        const date = datetime.getDate();
        const monthDate = month + (date / 100);
        if (monthDate >= 3.21 && month < 6.21) {
            return Seasons.spring;
        } else if (monthDate >= 6.21 && month < 9.21) {
            return Seasons.summer;
        } else if (monthDate >= 9.21 && month < 12.21) {
            return Seasons.autumn;
        } else {
            return Seasons.winter;
        }
    }
18400cookie-checkCalculate Season For Given Date (astrological)