Live data from Hacker News

JavaScript Temporal is coming

developer.mozilla.org

371–380 of 416 posts

Re: JavaScript Temporal is coming

#371

Can someone who's been following this explain why they're designing a new API instead of merging one of the successful open source APIs into the standard?

they might be successful but they are still very lacking. Temporal is very complete!

Re: JavaScript Temporal is coming

#373

It’s almost a shame, considering all the effort that went into Moment and Luxon, which will largely be superseded. Luxon especially is a joy to work with.

IIRC Luxon doesn't have the concept of Calendar/Naive date/time, which is one of the major improvements brought by Temporal for me

Re: JavaScript Temporal is coming

#374
post #210

Earlier quoted context omitted.

I spent a day fighting with date-fns trying to get some date calculations working and was to the point I was questioning if my entire approach was flawed because there was no reason I should be spending that much time figuring our some simple date calculations. Eventually I decided to try swapping to Luxon. 30 minutes later and it was all working. I'm still guessing I misunderstood something fundamental about date-fn…

For the longest time date-fns approach to timezones was "Do you really need timezones? Aren't UTC offsets enough?" which was pretty fatal for a date time library, no matter how simple and light it makes your bundle. It looks like they did finally launch TZ support in September last year, and I haven't investigated it (and probably never will, given Temporal is coming a Temporal polyfill seems a better option)

date-fn's gaslighting on timezones was so weird. I now see that they're planning duration support, but it's clear that its usefulness is fading

Re: JavaScript Temporal is coming

#377

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/…

Even countries that are on UTC don't save you from this. I had no idea until very recently but there is a time that simply never existed in Iceland! Wednesday January 2st 1908 00:00 clocks were turned forward 28 minutes to 00:28. So an entire 28 minutes of time never eexisted in Iceland even thought today they are on UTC year round and one might think they are the best and easiest country to handle timezone wise. htt…

I should point out that UTC didn't begin until 1960...

The 28 minutes jump is likely Iceland coming into alignment with GMT, for much the same reasons as Ireland did; to improve trade and commerce in a world now using telegraphs, telephones and trains. We're ok becoming disconnected from mean solar time in order to connect more with each other.

Samoa skipped a day in 2011, jumping from UTC−11:00 to UTC+13:00, so that it could align with Australia and New Zealand, its biggest trading partners -- so Australia's Friday is also Samoa's Friday.

We'll always have discontinuities in civil timekeeping, as it's there to serve the whims of humans, not the other way around.

Re: JavaScript Temporal is coming

#378

Very sad that .Now is not a function call. It shouldn't be a property. Evaluating .Now multiple times in a loop will yield different values, which is unexpected. C# did the same and it shouldn't have been: https://ericlippert.com/2014/05/19/when-should-i-write-a-pro...

I think you got it wrong. Now is a namespace for functions that retrieve the actual values, such as Now.instant()

Re: JavaScript Temporal is coming

#379

Earlier quoted context omitted.

Even countries that are on UTC don't save you from this. I had no idea until very recently but there is a time that simply never existed in Iceland! Wednesday January 2st 1908 00:00 clocks were turned forward 28 minutes to 00:28. So an entire 28 minutes of time never eexisted in Iceland even thought today they are on UTC year round and one might think they are the best and easiest country to handle timezone wise. htt…

I should point out that UTC didn't begin until 1960... The 28 minutes jump is likely Iceland coming into alignment with GMT, for much the same reasons as Ireland did; to improve trade and commerce in a world now using telegraphs, telephones and trains. We're ok becoming disconnected from mean solar time in order to connect more with each other. Samoa skipped a day in 2011, jumping from UTC−11:00 to UTC+13:00, so that…

The UK skipped 11 days in 1752. There were riots.

Re: JavaScript Temporal is coming

#380

The vast majority of websites should be calculating dates in a server and merely presenting them to clients. I have wondered why there isn’t a span style element which takes a UTC timestamp and presents it to the user in their preferred time zone. I even wonder if it could be done in private way so that JS cannot even access the value (made more difficult by layout and size). Similarly a form element for date times c…

A lot of calculations may happen on the client. And the server may be written in JavaScript.
Post reply on HN