Looking at the caniuse results... f*king Safari (and Opera)... https://caniuse.com/temporal
Temporal: The 9-year journey to fix time in JavaScript
111–120 of 284 posts
Re: Temporal: The 9-year journey to fix time in JavaScript
#112My playbook for JavaScript dates is.. store in UTC.. exchange only in UTC.. convert to locale date time only in the presentation logic. This has worked well for me enough that Im skeptical of needing anything else
Re: Temporal: The 9-year journey to fix time in JavaScript
#113[flagged]
When I write JavaScript, I make as many things immutable as I can. Sometimes it adds verbosity and leads to less efficient computational patterns, but overall I believe I run into far fewer bugs that are hard to make sense of. There are things about the design of Temporal I don't really like, but immutability was a solid move. What I don't understand is why they had to make string formatting so rigid. Maybe it has to…
Re: Temporal: The 9-year journey to fix time in JavaScript
#114From the link, we can see Temporal does have separate Date/Time/Datetime types. ("PlainDate" etc)
Re: Temporal: The 9-year journey to fix time in JavaScript
#115My playbook for JavaScript dates is.. store in UTC.. exchange only in UTC.. convert to locale date time only in the presentation logic. This has worked well for me enough that Im skeptical of needing anything else
Re: Temporal: The 9-year journey to fix time in JavaScript
#116Re: Temporal: The 9-year journey to fix time in JavaScript
#117Re: Temporal: The 9-year journey to fix time in JavaScript
#118Re: Temporal: The 9-year journey to fix time in JavaScript
#119Earlier quoted context omitted.
Yeah exactly. That's what I've loved about Rust and hated about real-world JS. I end up having to reason about an entire case that might not be real at all: does this function mutate what I'm passing it? Should I eagerly deep copy my object? UGH.
Just call "Object.freeze()" before "return" in your function.