Skip to content

Conversation

monovertex
Copy link
Collaborator

@monovertex monovertex commented Sep 23, 2018

Previously, when building the month select, the current month was taken out of the available options from the generated range (bound between startDate / 0 and endDate / 11). However, when the selected date range was in the same month as endDate, for all months after the endDate's month, the select would no longer display the proper current month, as it was no longer visible in the available options.

This issue was presented in #412. However, the fix introduced there, which modified the available months range, breaks the month select, because it always limits the range to the current month, not allowing the user to select months past the currently visible month in the picker. This issue is reported in #452.

The proper fix was to update the select builder so that it can display disabled options, thus allowing the selected month to be displayed in the dropdown and properly build the control, without allowing the user to actually select that option. This should make the control more robust and keep the user happy.

Closes #412. Closes #452.

JSFiddle showcasing the fixed version.

@monovertex monovertex force-pushed the bugfix/fix-out-of-bounds-current-month-when-generating-month-select branch from ed82137 to 1cbb9fd Compare September 23, 2018 20:50
@monovertex monovertex changed the title Bugfix/#412, #452 - Fix out-of-bounds month when building the month select Bugfix/#412, #452 - Fix out-of-bounds options when building the month/year selects Sep 23, 2018
@monovertex monovertex merged commit cfe9d9c into longbill:master Sep 26, 2018
@monovertex monovertex deleted the bugfix/fix-out-of-bounds-current-month-when-generating-month-select branch September 26, 2018 19:04
@monovertex monovertex mentioned this pull request Sep 26, 2018
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.

Month dropdown does not show all months Month UNDEFINED if shortcuts and monthSelect are enabled
3 participants