Using a string for initialViewDate does not work
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 858
- PR merge metrics
- No merged PRs in 30d
Description
### I'm Submitting a ...
```
[ x ] Bug report
[ ] Feature request
[ ] Support request
```
### Steps to Reproduce
Use the Datetime component and provide an initialViewDate string in DateTime format:
e.g. 2021-02-15T13:29:00Z
### Expected Results
When the picker is used it shows the correct Date and time
### Actual Results
The current date is shown and 12:00 is shown for the time
### Minimal Reproduction of the Problem
https://codepen.io/jasonleenaylor/pen/WNoWbze
### Other Information (e.g. stacktraces, related issues, suggestions how to fix)
Setting initialViewDate to a Date constructed with the string works properly.
Contributor guide
Research direction
Open the linked CodePen reproduction and start at the Datetime component's handling of the initialViewDate prop. Compare the behavior when the value is a Date with the reported DateTime-format string. Done means the picker shows the supplied date and time when initialViewDate is provided as a string, while preserving the existing Date behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100