dance2die / calendar-dates

📆 Get a list of calendar dates with no external dependencies.
https://www.npmjs.com/package/calendar-dates
MIT License
14 stars 3 forks source link

Years don't roll over correctly after December #26

Closed coraunderhill closed 5 years ago

coraunderhill commented 5 years ago

Steps to reproduce

Create a new Date using December 2018 as your target.

Expected behavior

After December 31st is reached, the calendar should roll over into January of 2019

Actual behavior

The calendar continues the month count into 2018-13 instead of 2019-01 as expected

example

Environment data

npm --version: 6.4.1

dance2die commented 5 years ago

@coraunderhill Oh yikes 😲. Thank you for the report

I will fix it~

dance2die commented 5 years ago

It seems like the problem also occurs for January as well, where ISO month is set to 0, not 1

dance2die commented 5 years ago

Thank you, @coraunderhill. The issue is fixed in version 2.4.4 (and added the tests as well).