UserFrosting icon indicating copy to clipboard operation
UserFrosting copied to clipboard

Automatic timezone conversion

Open Silic0nS0ldier opened this issue 7 years ago • 5 comments

Dealing with timezone conversion is always a pain. Client timezone is unknown on the backend, and writing scripts to convert for the frontend is easy to mess up. A standardised out-of-box solution would be fantastic.

Silic0nS0ldier avatar Feb 03 '18 21:02 Silic0nS0ldier

Question is, should the backend or the frontend be in charge of setting the timezone for the other one?

It could be set as a per user in their profile, but it's not great UX if the user physically travel to a new timezone...

lcharette avatar Feb 05 '18 04:02 lcharette

There's gotta be a third-party library for this somewhere.

alexweissman avatar Feb 05 '18 04:02 alexweissman

@Malou Hence the "needs discussion" and "long-range planning" labels.

Issue with backend is that you don't necessarily know the users timezone since it isn't sent with the request. Which is annoying cause if its done on the backend automatically, its a lot less tedious since there isn't some script you need to remember to apply. Hmm. Would have to remember to convert back to data source timezone on save too.

@alexweissman I'm sure there is. Just not too sure how well it would go with abstracting all the work away. Ideal scenario would be all stuff directly integrated (plus official addons) don't require any manual conversions at all. Libraries can probably help (unless what we already have can be put to work).

Depending on scope, this could be a feature of a 4.X release behind a config switch (for backwards compatibility), or a part of the mythical UF5.

Silic0nS0ldier avatar Feb 05 '18 05:02 Silic0nS0ldier

On the note of scope, its probably worth doing an audit to figure out where time is written and read in UF.

Silic0nS0ldier avatar Feb 05 '18 06:02 Silic0nS0ldier

This should probably be figured out along the localized date PIA, especially if we’re looking at date input and new external library.

lcharette avatar Feb 05 '18 11:02 lcharette