react-datepicker
react-datepicker copied to clipboard
Today's date button does not work with utcOffset
Steps to reproduce:
- Go to examples page: https://hacker0x01.github.io/react-datepicker/
- Make sure today button is working in example "Today button"
- Open date picker in example "TimeZone date"
- Click today button
Result: nothing is set in the input Expected result: today's date is set in the input (with respect to chosen utcOffset)
Thanks for reporting, apparently there were two issues with the example:
- Set minDate and maxDate, but were not shown in code snippet. Depending on the date, "today" might have been an invalid date.
- Moment.js apparently removed ambiguity when setting UTC offset. Previously every number <= 12 was counted as offset in hours, now you have to set it in minutes all the time: https://momentjs.com/docs/#/manipulating/utc-offset/
I'll open a PR to fix this in the next minutes.