Live data from Hacker News

JavaScript Temporal is coming

developer.mozilla.org

11–20 of 416 posts

Re: JavaScript Temporal is coming

#11

They should add an event to detect when someone changes timezones. That could be another entry in the "falsehoods that programmers believe about time": programmers believe that your timezone is fixed during usage. But in reality there are millions of people moving between timezones every day.

If you are on a plane or ISS you could even be timezoneless.

Iss uses Coordinated Universal Time which is just GMT.

Re: JavaScript Temporal is coming

#12

They should add an event to detect when someone changes timezones. That could be another entry in the "falsehoods that programmers believe about time": programmers believe that your timezone is fixed during usage. But in reality there are millions of people moving between timezones every day.

Where would you expect this event to be used? I don't think most web applications somewhat dependent on time should directly have to listen and respond to these events for the amount of people affected by it just doesn't justify the extra effort, I would assume. Libraries could benefit, of course.

Re: JavaScript Temporal is coming

#13
There are quite a few things marinating in the TC39 pot right now. This is one that I wish would ship sooner, rather than later. I do recognize that it takes dev effort (on the part of v8, JSC, and SpiderMonkey engineers) to get the major browsers to support any of these new features. So I truly appreciate all that folks are doing to move the ball forward. The impatient person in me is cheering, "now get Records and Tuples going too! You can skip that silly Pipe-syntax war if you want!"

Re: JavaScript Temporal is coming

#14

They should add an event to detect when someone changes timezones. That could be another entry in the "falsehoods that programmers believe about time": programmers believe that your timezone is fixed during usage. But in reality there are millions of people moving between timezones every day.

If you are on a plane or ISS you could even be timezoneless.

I.i.r.c. ISS uses UTC

Re: JavaScript Temporal is coming

#15

They should add an event to detect when someone changes timezones. That could be another entry in the "falsehoods that programmers believe about time": programmers believe that your timezone is fixed during usage. But in reality there are millions of people moving between timezones every day.

The client's timezone should only matter to the client. There's no condition where their clock matters except to translate a timestamp into their local time (for their convenience). Who cares if they change time zones?

Re: JavaScript Temporal is coming

#16

Coming but only available in one browser or run time, and then with a feature flag.

That's generally how that works for new things like this. It is rare for a new thing like this to be adapted by everyone at the exact same time.

Certainly within the context of browsers. There is a reason why websites like https://caniuse.com exist in the first place. If you pay attention you will also see that for APIs on MDN it will also have a browser compatibility list.

Re: JavaScript Temporal is coming

#18

They should add an event to detect when someone changes timezones. That could be another entry in the "falsehoods that programmers believe about time": programmers believe that your timezone is fixed during usage. But in reality there are millions of people moving between timezones every day.

Suggestion, design your app to not be time zone dependant if at all possible.

For example, store dates in UTC and render instantaneously in current time zone.

Re: JavaScript Temporal is coming

#19
post #4

If the time zone handling can be added like Golang time package, that would make it very convenient.

that'll work as soon as everyone in the world agrees to download the latest version of their favorite web browser each time Western Sahara is reclassified

Re: JavaScript Temporal is coming

#20

There are quite a few things marinating in the TC39 pot right now. This is one that I wish would ship sooner, rather than later. I do recognize that it takes dev effort (on the part of v8, JSC, and SpiderMonkey engineers) to get the major browsers to support any of these new features. So I truly appreciate all that folks are doing to move the ball forward. The impatient person in me is cheering, "now get Records and…

Records.. Wasn't Dictionary an ECMA5 proposal or was that just a novel touch in AS3?

[edit: For those who don't know, Dictionary was a type in AS3 that let you use any object reference or string or number as a unique key, with any type of value attached. Garbage collection worked around this so it wasn't a weak reference as long as the dictionary object itself was alive. Think of a Javascript Set except with strongly typed keys of any kind you specified. Errors thrown at compile time. God..I miss that language.]

Post reply on HN