Skip to content

Commit

Permalink
Aligning year selector to use zero indexed months
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
duckboy81 committed May 1, 2019
1 parent 94d0a79 commit 711bf96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zebra_datepicker.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@
if ($.inArray('months', views) === -1)

// put selected date in the element the plugin is attached to, and hide the date picker
select_date(selected_year, 1, 1, 'years', $(this));
select_date(selected_year, 0, 1, 'years', $(this));

else {

Expand Down

0 comments on commit 711bf96

Please sign in to comment.