[DatePicker] - Wrong month names with preset value
See original GitHub issueDescription
When a value or a default value is set on the component with a date turning point the date selector shows wrong month names.
Here is an example. I’m in GMT+1 and if I set the value to new Date(2017, 10, 21, 0, 0, 0)
the following happens:
- The input field and the calendar sidebar will show 11/20/2017 selected correctly and the calendar title will show November 2017
- Clicking on the next month selector the calendar title will still show November 2017 but the days and weeks will change
- Clicking on the previous month selector the calendar title will show October 2017, but the days and weeks will actually show November
- Selecting a date will pick the correct value
By setting the value to new Date(2017, 10, 21, 2, 0, 0)
this issue is not reproducible.
I’ve also noticed the following two issues:
- The days within the months are shown incorrectly, e.g. November starts with the date 30 and ends with the date 30
- The current date is shown correctly in the sidebar but incorrectly in the calendar, the previous day is highlighted as the current date and is selected by default
Version
- React - 16.1.1
- React-MD - 1.2.8
- Browser - Reproducible on Chrome, Safari, Firefox, Opera
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:14 (8 by maintainers)
Top Results From Across the Web
DatePicker shows wrong value of month - Stack Overflow
If you have an array with the names of the months, you want the months to be zero indexed to match with this...
Read more >Datepicker is passing wrong values - WordPress.org
Hi,. The datepicker is showing when I press on the input field, but it is passing wrong values. I want to display some...
Read more >jQuery UI Datepicker
The jQuery UI Datepicker is a highly configurable plugin that adds datepicker functionality to your pages. You can customize the date format and...
Read more >Datepicker Is Returning Wrong Month (showing the month selec
Expected behavior I am using using Datepicker for the first time. The pop up is working as expected. When I click on a...
Read more >Datepicker in Angular using mat-datepicker | Material Design
Instead of that if we want to set the view to current year we can use startView property of mat-datepicker . Allowed values...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mlaursen any update on this one?
Here’s a little update for this issue:
I had to make a different
DatePicker
for work that has solved most of the date problems that we are seeing here and are finishing QA on them by next Thursday. Once it is done with QA, I’ll start working on moving the correct logic into here. I’m hoping I can get the date fixes into a patch instead of a major/minor release, but if it can’t I’ll put them in the 1.3.0 release. In 2.0.0 or 1.3.0 I’ll also be adding some newer Date, Time, and DateTime pickers that will allow for text input as well.