Search and Top Navigation
#15126 closed bug (notabug)
Opened January 11, 2017 10:53AM UTC
Closed January 11, 2017 01:51PM UTC
Month and year in datepickers dropdown are not refreshing on MM-yy format
Reported by: | VishmayShah | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.datepicker | Version: | 1.12.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
In date picker if your textbox type is month and year only,
You select a date like April 2018 and focus out of textbox
again focus back in textbox and open datepicker and you will find that it started with first value in change year and month dropdowns
let me know if further inputs are required
$(function () { $('.date-picker').datepicker({ changeMonth: true, changeYear: true, showButtonPanel: true, dateFormat: 'MM yy', onClose: function (dateText, inst) { var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val(); var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val(); $(this).datepicker('setDate', new Date(year, month, 1)); } }); });
Attachments (0)
Change History (1)
Changed January 11, 2017 01:51PM UTC by comment:1
component: | ui.core → ui.datepicker |
---|---|
resolution: | → notabug |
status: | new → closed |
That's not a valid date format. The datepicker picks dates, not months.