Use DATE_FORMAT when parsing selected date #61
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Potential fix for #60, at least in 'single' mode.
I implemented the datepicker a few days ago in one of our projects and everything worked fine until yesterday. Not sure if a third-party library, such as Dayjs, was changed recently and if that caused this functionality to break, but I was able to narrow down the problem:
At least in the 'single' view mode, the date is sent back in the format "YYYY-MM-DD" (DATE_FORMAT) and not "YYYY-MM-DD HH:mm" (CALENDAR_FORMAT), but the CALENDAR_FORMAT is assumed while parsing.
Since I don't know the code base that well, this definitely should be tested with modes other than 'single', since that is the only mode we're using in our project. Additionally, it might be possible to get the date in the CALENDAR_FORMAT even when you're only picking a 'single' date. That would also prevent the problem and might be a more generic/better solution.