Hacker News new | past | comments | ask | show | jobs | submit login

Both the builtin lib, and the popular moment lib are missing separate date and time types, which leads to subtle errors. (ie when using their workaround of using datetime types for either). From the article, it appears Temporal has the same problem. There's nothing wrong with mutable types, which is common in JS discussions; the problem is when the API mutates in place where this isn't obvious.

I hand-wrote date and dt types with basic operations instead. Limited functionality, eg timezones, formatting etc, but behaves as you'd expect.

Another option might be to wrap Rust's Chrono lib in WASM, then call from JS; it's the best DT lib I've seen in any language.





Awesome. It looks like it has a PlainDate type as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: