Live data from Hacker News

JavaScript Temporal is coming

developer.mozilla.org

171–180 of 416 posts

Re: JavaScript Temporal is coming

#171

Earlier quoted context omitted.

in python, 'pendulum' is the datetime swiss army knife. If you havent been using it, you should check it out

I'd suggest `whenever`, which has taken inspiration from Temporal: https://github.com/ariebovenberg/whenever For Pendulum, I'd suggest folks take a gander at its issue list to see if the bugs reported are 1) real and 2) something you can live with. Well, when GitHub is back up anyway. Lol.

Thanks for the headsup

Re: JavaScript Temporal is coming

#172

From TFA: > When JavaScript was created in 1995, the Date object was copied from Java's early, flawed java.util.Date implementation. Java replaced this implementation in 1997, but JavaScript is stuck with the same API for almost 30 years, despite known problems. I'm not a JavaScript or web developer, and I was surprised by the above. Can anyone comment on why the language was stuck with an inadequate api for so long?…

Going back even further in time, Java.util.Date was was heavily inspired by a C library. That’s the origin of getMonth() in Java (and therefore in JS) returning a value from 0-11 and not 1-12 as many coders initially expect. What was the origin for this peculiarity in C? That I don’t know, but I’m curious to find out if anyone knows.

Just spitballing, but in C it was always the convention to use zero-based indexing. Probably because you were often adding these indexes to pointers (literal memory addresses) to index into an array, so you needed a zero to index into the first slot of the array.

Re: JavaScript Temporal is coming

#173

Curious to see how Temporal works with JS on the client side! It’s an awesome tool for durable execution, I’ve been using it in my OSS projects, and it has been instrumental in building a leading Reverse ETL platform powered by Temporal. https://github.com/Multiwoven/multiwoven

this is about a new datetime library in ecma standard, not the orchestration service temporal.io

Re: JavaScript Temporal is coming

#174

> working with dates and times in JavaScript will be hugely simplified > To help you get up to speed, there are over 270 pages of Temporal docs on MDN Not that I'm complaining about extensive documentation, but seeing these two lines juxtaposed doesn't inspire much confidence.

There is only so much you can do to simplify such a complex domain as time.

Re: JavaScript Temporal is coming

#175
post #165

Earlier quoted context omitted.

Since it's built into the browser it's probably updated when the browser is updated. Browser vendors did a lot of work to update quickly, browsers are probably the most up-to-date software on your average person's computer.

Please don't forget about us node users (and deno and bun I guess, too).

deno added this about a year ago https://docs.deno.com/api/web/~/Temporal https://deno.com/blog/v1.40#temporal-api

Re: JavaScript Temporal is coming

#177

Earlier quoted context omitted.

in python, 'pendulum' is the datetime swiss army knife. If you havent been using it, you should check it out

I'd suggest `whenever`, which has taken inspiration from Temporal: https://github.com/ariebovenberg/whenever For Pendulum, I'd suggest folks take a gander at its issue list to see if the bugs reported are 1) real and 2) something you can live with. Well, when GitHub is back up anyway. Lol.

thanks to you both, I'll check whenever and Pendulum out! :)

Re: JavaScript Temporal is coming

#178

Earlier quoted context omitted.

+02:00 is not political. It's an offset from UTC and will be the same offset in the past and future. Europe/Paris is political. It defines that offsets change at certain times of the year, but that could change tomorrow, or the political boundary that the timezone applies to could split such that the person or entity needing a time in their "local" timezone finds another one needs to be picked (see various US states/…

I wonder what happens when a timezone ceases to exist, e.g. what if Paris is renamed to New New York after the British take revenge and take over France.

Then Europe/Paris will become an alias for Europe/NewNewYork

Re: JavaScript Temporal is coming

#179
post #160

Does this mean we can finally stop downloading and running a third of a MB of js on every website? moment.js, luxon, date-fns, are all obsolete? https://bundlephobia.com/package/moment@2.30.1

The implications of Temporal are absolutely huge. This is a game-changer and I can't wait to see how everyone benefits, developers and users alike.

how are they huge?

Re: JavaScript Temporal is coming

#180

> working with dates and times in JavaScript will be hugely simplified > To help you get up to speed, there are over 270 pages of Temporal docs on MDN Not that I'm complaining about extensive documentation, but seeing these two lines juxtaposed doesn't inspire much confidence.

There is only so much you can do to simplify such a complex domain as time.

But there is a lot you can do to make your description reflect that reality
Post reply on HN