-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new Date
does not work with a valid ISO-8601 date string
#400
Comments
Okay. This is bad. |
@sean-clayton Try to use Storybook |
Reopen if this doesn't solve your issue. |
Instead of replacing es5-shim, could you perhaps have filed a bug on it? I'll be happy to fix it and publish a replacement ASAP. |
@sean-clayton have you tried that Date string in other browsers than Chrome? Unless all the browsers parse it the same, then "Invalid date" is in fact the proper thing for |
@ljharb That's due to sudden of the release of Storybook 2. I think it was too quick. |
Issue #400 is only related to a Chrome thing. So, it's fine to use where the standards lie.
Issue #400 is only related to a Chrome thing. So, it's fine to use where the standards lie.
This is still happening with this versions Storybook - ^6.0.28 Error log in Chrome Firefox and Safari working as expected. |
I'm using the
react-intl
library which relies onnew Date()
to function for date formatting. Storybook injects a few ES5 shims fromes5-shim
(fromairbnb-js-shims
), which overwrites the browsersDate
function with its own. Usinges5-shim
'sDate
function, it cannot parse this valid ISO 8601 date string: "2017-04-31T10:39:10-04:00", and returnsInvalid date
. Unfortunately, we're using Storybook to test these components which heavily rely on dates and we're constantly seeingInvalid date
.In the following, you'll notice the same date will return different results on a vanilla Chrome instance with and without Storybook
Expected (vanilla Chrome)
Currently (vanilla Chrome with Storybook)
The text was updated successfully, but these errors were encountered: