Open andys8 opened 5 years ago
Hello @andys8,
I guess it's totally ok because we run Task.perform GotTimeZone Time.here in init function and setup correct timezone then.
I wouldn't go with "totally okay". If it is implemented in this way, then it's not that bad in practice, but there is one point in time where the state is not right.
"Making impossible states impossible" 😉
I know the checks are cumbersome, but we should go with Maybe a
here.
Edit: I updated the initial issue text
Issue
The time zone is not read from the browser, but instead set to
utc
(edit: in the initializing phase).https://github.com/rtfeldman/elm-spa-example/blob/b5064c6ef0fde3395a7299f238acf68f93e71d03/src/Page/Home.elm#L71
https://github.com/rtfeldman/elm-spa-example/blob/b5064c6ef0fde3395a7299f238acf68f93e71d03/src/Page/Profile.elm#L65
https://github.com/rtfeldman/elm-spa-example/blob/b5064c6ef0fde3395a7299f238acf68f93e71d03/src/Page/Article.elm#L68
See
https://package.elm-lang.org/packages/elm/time/latest/Time#here https://guide.elm-lang.org/effects/time.html