check-season
v1.0.0
Published
The package adds a function to determine the time of year
Downloads
6
Readme
To find out the season of the year, use the getSeason(date)
function, which takes а Date
object and returns the time of the year that matches it.
If the date
argument was not passed, the function return the string
'Unable to determine the time of year!'
. If the date
argument is invalid, the function will throw an Error
with message Invalid date!
.
For example:
const springDate = new Date(2024, 03, 31)
getSeason(springDate)
=> 'spring'