arqex / react-datetime

A lightweight but complete datetime picker react component.
1.99k stars 873 forks source link

Using a string for initialViewDate does not work #783

Open jasonleenaylor opened 3 years ago

jasonleenaylor commented 3 years ago

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.