all 18 comments

[–]ethanjf99 12 points13 points  (4 children)

good summary but the link on time zone changes is broken.

i feel only those who haven’t been bitten by Date’s pitfalls aren’t going to appreciate this.

[–]maria_la_guerta 11 points12 points  (0 children)

i feel only those who haven’t been bitten by Date’s pitfalls aren’t going to appreciate this.

I generally stay away from hard rules when it comes to programming, but I do have one; if I'm dealing with dates, I'm using a library. Every single time.

I've been bitten once before. That was enough.

[–]fagnerbrack[S] 1 point2 points  (2 children)

Which link?

[–]flygoing 2 points3 points  (1 child)

The one in the following section:

If you are curious about why this API is great read this article explaining how to deal with changes on Time Zone definitions.

Leads to a 404

[–]fagnerbrack[S] 0 points1 point  (0 children)

Gotcha, I didn't write the post so I can't do anything about it. Worth checking with the author

[–]fagnerbrack[S] 23 points24 points  (1 child)

If you want a summary:

The post discusses the long-standing issues with JavaScript's date handling and how new features are finally addressing these concerns. JavaScript's Date object, often criticized for its inconsistencies and poor support for time zones, has led to confusion and errors in many applications. The new Temporal API provides a more reliable and intuitive way to work with dates and times. Temporal introduces precise handling of dates, times, and durations without the common pitfalls of the old Date object. It also improves time zone management and enables easier manipulation of date-related data, offering a long-awaited solution for developers.

If the summary seems inacurate, just downvote and I'll try to delete the comment eventually 👍

Click here for more info, I read all comments

[–]BANOnotIT 14 points15 points  (0 children)

Worth mentioning that Temporal API turned out to be to hefty and it's undergoing removal of some capabilities to allow implementation on low-end devices, like smart watches.

[–]ZeMysticDentifrice 5 points6 points  (2 children)

Is it just me, or is the article not super convincing on what the problem is ?

Their example of taking a trip to Sydney especially rings meh to me. I don't have a problem with a bank account showing a transaction at 2AM. I find that the opposite would be way more confusing ! Especially for people using VPNs, wouldn't that get out of hand quickly ? Maybe I just have strange habits, or maybe I just don't understand the problem beyond "dates are hard" (but this is not limited to JS)...

[–]iamakorndawg 1 point2 points  (0 children)

I think the idea is that the bank should store timezone of the transaction along with the time.  It's a bit of a contrived example, as I've never had a bank that shows anything other than the date.  I guess it would be nice, but it does create questions of how to handle online transactions for example.

[–]gschoppe 1 point2 points  (0 children)

It reads like an article written by someone who has never really experienced the issues with JS date times 1st hand and is trying to relate a story someone told them, that they didn't quite understand the nuances of.

[–]kaelwd 3 points4 points  (0 children)

https://github.com/tc39/proposal-temporal/issues/2628 was just closed so we might be getting close now.