3 ms·
Yes. But front-end JS takes it to the next level by, for example, not providing any sane way to get the current locale.
by draw_down 11y ago
Yes. But front-end JS takes it to the next level by, for example, not providing any sane way to get the current locale.
- xlm1717 11y agoJust don't do it on the front-end. Never do it on the front-end.
- draw_down 11y agoYou have to. User specifies thing should happen at 2PM, their time, then POSTs that data to your API or whatever. Well, what time are they actually talking about? You need to know.
- toomuchtodo 11y agoYou ask the user what time zone they're in? Better to have accurate data then guess.
- redrummr 11y agoEspecially considering this is consistent with not identifying the device beyond headers sent etc. and you can't just use an IP address to map the timezone as it may be shared at the tower/exchange kilometres away (DSL) or hundreds of kilometres away (wireless/cell) and cross timezones. The best strategy is to suggest the [timezone|local shop|city name|whatever] and prompt for confirmation.
- douche 11y agoMoment.js is a must-have.
- nstr007 11y agoIf only we didn't need to add so much to our payload just to handle dates.
- ErikAugust 11y agogetTimezoneOffset()