You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really appreciate this library for handling dates across different time zones.
Thans to the date-fns-tz developers for providing such a useful library.
I'm confused about the toDate function. When I input a string like 2023/11/11, which is not an ISO8601 time string, toDate returns 2022-12-31T16:00:00.000Z date.
I noticed that the datePattern in the splitDateString function returns a matched result as shown below:
Hi there,
I really appreciate this library for handling dates across different time zones.
Thans to the date-fns-tz developers for providing such a useful library.
I'm confused about the
toDate
function. When I input a string like2023/11/11
, which is not an ISO8601 time string,toDate
returns2022-12-31T16:00:00.000Z
date.I noticed that the
datePattern
in the splitDateString function returns a matched result as shown below:As a result,
dateStrings.date
only captures the year (2023), leading todate.setUTCFullYear(2023)
.Is there any plan to either restrict or support this specific time string format?
This is my codeSendBox to present these different case result.
https://codesandbox.io/s/date-fns-tz-todate-4mql3c?file=/src/index.mjs
Thanks
The text was updated successfully, but these errors were encountered: