generated from nhcarrigan/template
feat: update this highly outdated app to use latest packages and custom configs (#1)
Reviewed-on: https://codeberg.org/nhcarrigan/tingle-bot/pulls/1 Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com> Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
This commit is contained in:
@ -1,4 +1,9 @@
|
||||
import { Season } from "../../interfaces/weather/names/Season";
|
||||
/**
|
||||
* @copyright nhcarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
import type { Season } from "../../interfaces/weather/names/season.js";
|
||||
|
||||
/**
|
||||
* Module to get the season based on today's date.
|
||||
@ -6,21 +11,20 @@ import { Season } from "../../interfaces/weather/names/Season";
|
||||
* Spring: March 21 - June 20.
|
||||
* Summer: June 21st - September 22.
|
||||
* Fall: September 23 - December 21.
|
||||
*
|
||||
* @returns {Season} The season name.
|
||||
* @returns The season name.
|
||||
*/
|
||||
export const getSeason = (): Season => {
|
||||
const date = new Date();
|
||||
const month = date.getMonth();
|
||||
const day = date.getDate();
|
||||
|
||||
if (month < 2 || (month === 2 && day < 21) || (month === 11 && day > 20)) {
|
||||
if (month < 2 || month === 2 && day < 21 || month === 11 && day > 20) {
|
||||
return "Winter";
|
||||
}
|
||||
if (month < 5 || (month === 5 && day < 21)) {
|
||||
if (month < 5 || month === 5 && day < 21) {
|
||||
return "Spring";
|
||||
}
|
||||
if (month < 8 || (month === 8 && day < 23)) {
|
||||
if (month < 8 || month === 8 && day < 23) {
|
||||
return "Summer";
|
||||
}
|
||||
return "Fall";
|
||||
|
Reference in New Issue
Block a user