Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align year selector to use zero indexed months #139

Merged
merged 1 commit into from
May 2, 2019
Merged

Align year selector to use zero indexed months #139

merged 1 commit into from
May 2, 2019

Conversation

duckboy81
Copy link
Contributor

When using a year selector, the datepicker will return February of the selected year due to the fact that the JavaScript Date object's month value is zero index based. Updating the value passed here will direct the select_date function to pass the correct month value to the Date object.

**Example**
Selected year: 2018
Expected Date obj value: Mon Jan 01 2018 12:00:00 GMT+0000
Actual Date obj value: Thu Feb 01 2018 12:00:00 GMT+0000

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

When using a year selector, the datepicker will return February of the selected year due to the fact that the JavaScript Date object's `month` value is zero index based. Updating the value passed here will direct the `select_date` function to pass the correct `month` value to the Date object.
@stefangabos stefangabos merged commit 7aaaa96 into stefangabos:master May 2, 2019
@stefangabos
Copy link
Owner

Thank you!

@duckboy81 duckboy81 deleted the duckboy81-patch-1 branch May 3, 2019 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants