We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Date.Format.formatISO8601 appears to be ignoring time zone information.
Date.Format.formatISO8601
Here, in the repl, Date.fromString appears to parse dates correctly; toString shows them in BST or GMT depending when they fall in the year :
Date.fromString
toString
> Date.fromString "2015-11-10T20:34:17Z" Ok <Tue Nov 10 2015 20:34:17 GMT+0000 (GMT)> : Result.Result String Date.Date > Date.fromString "2015-10-10T20:34:17Z" Ok <Sat Oct 10 2015 21:34:17 GMT+0100 (BST)> : Result.Result String Date.Date
But when I use Date.Format.formatISO8601 these two examples result in different times: both should be 20:34, but the one in October shows up as 21:34:
20:34
> Date.fromString "2015-11-10T20:34:17Z" |> Result.map Date.Format.formatISO8601 Ok "2015-11-10T20:34:17Z" : Result.Result String String > Date.fromString "2015-10-10T20:34:17Z" |> Result.map Date.Format.formatISO8601 Ok "2015-10-10T21:34:17Z" : Result.Result String String
The text was updated successfully, but these errors were encountered:
Fix bug with time zone
2c0fb74
Use Date.Extra in place of DateFormat to parse and format dates, to avoid bug with date format not respecting time zones mgold/elm-date-format#18
@mgold as discussed on slack general, Date.hour returns a value adjusted by the timezone offset, but the Date library does not provide an easy way to get the timezone offset. However, it is possible. See https://github.com/justinmimbs/elm-date-extra/blob/2.0.3/src/Date/Internal/Extract.elm#L61
Date.hour
Date
Sorry, something went wrong.
Thanks for the heads-up.
What do you think about just merging this library into elm-date-extra? Seems silly not to if it's going to depend on it.
No branches or pull requests
Date.Format.formatISO8601
appears to be ignoring time zone information.Here, in the repl,
Date.fromString
appears to parse dates correctly;toString
shows them in BST or GMT depending when they fall in the year :But when I use
Date.Format.formatISO8601
these two examples result in different times: both should be20:34
, but the one in October shows up as 21:34:The text was updated successfully, but these errors were encountered: