elm-spa-example icon indicating copy to clipboard operation
elm-spa-example copied to clipboard

Timezone is set to UTC

Open andys8 opened this issue 7 years ago • 2 comments

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

andys8 avatar Nov 19 '18 10:11 andys8

Hello @andys8,

I guess it's totally ok because we run Task.perform GotTimeZone Time.here in init function and setup correct timezone then.

catz avatar Mar 13 '19 09:03 catz

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

andys8 avatar Mar 13 '19 09:03 andys8