
Javascript Temporal - another feature no one asked for
Forum rules
The Off-Topic area is a general community discussion and chat area with special rules of engagement.
Enter, read and post at your own risk. You have been warned!
While our staff will try to guide the herd into sensible directions, this board is a mostly unrestricted zone where almost anything can be discussed, including matters not directly related to the project, technology or similar adjacent topics.
We do, however, require that you:
Please do exercise some common sense. How you act here will inevitably influence how you are treated elsewhere.
The Off-Topic area is a general community discussion and chat area with special rules of engagement.
Enter, read and post at your own risk. You have been warned!
While our staff will try to guide the herd into sensible directions, this board is a mostly unrestricted zone where almost anything can be discussed, including matters not directly related to the project, technology or similar adjacent topics.
We do, however, require that you:
- Do not post anything pornographic.
- Do not post hate speech in the traditional sense of the term.
- Do not post content that is illegal (including links to protected software, cracks, etc.)
- Do not post commercial advertisements, SEO links or SPAM posts.
Please do exercise some common sense. How you act here will inevitably influence how you are treated elsewhere.
-
- Knows the dark side
- Posts: 5584
- Joined: 2015-12-09, 15:45
Javascript Temporal - another feature no one asked for
Heads up for future implementation headaches and broken sites 

"One hosts to look them up, one DNS to find them and in the darkness BIND them."

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net
-
- Moon Magic practitioner
- Posts: 2401
- Joined: 2018-05-05, 13:29
Re: Javascript Temporal - another feature no one asked for
I asked for it (indirectly). Date sucks and this interface improves it, though almost anything improves over Date.
-
- Fanatic
- Posts: 131
- Joined: 2020-04-22, 18:47
- Location: Marietta, Ohio, USA, North America, Western Hemisphere, Earth, Milky Way, Universe, Multiverse
Re: Javascript Temporal - another feature no one asked for
According to various friends of mine who are webdevs, people have been asking for it.
-
- Pale Moon guru
- Posts: 37640
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: Javascript Temporal - another feature no one asked for
People have been asking for a new API with 200+ functions to replace Date() and related functions?
How much of this will be just another case of doing the same thing just slightly differently? How much of it is sugar for functions that are already widespread in standard function libraries everyone uses?
How much of this will be just another case of doing the same thing just slightly differently? How much of it is sugar for functions that are already widespread in standard function libraries everyone uses?
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Moon Magic practitioner
- Posts: 2401
- Joined: 2018-05-05, 13:29
Re: Javascript Temporal - another feature no one asked for
Yes.
A lot of them, probably, but the issue is that those libraries either use the broken Date or have to re-implement everything from scratch, neither of which are ideal.
-
- Pale Moon guru
- Posts: 37640
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: Javascript Temporal - another feature no one asked for
But that work has already been done...
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Pale Moon guru
- Posts: 37640
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: Javascript Temporal - another feature no one asked for
A quick read from the linked article, I stopped at this "explanation" for "why":
I also don't see how the parsing behaviour is unreliable (examples?)
Date being a mutable prototype is a positive, because it allows web devs to change it at will to cater to edge cases of Date or to add only those convenience functions that are needed for their use. What's bad about that?
This really does feel like a setup nobody asked for except those who want to control site scripting from the top down and from an implementation-first, client-code focused approach (i.e. Google Chrome).
So all the work that's been put into the Intl standard to deal with all this is supposed to be thrown out.The major issues with JavaScript's Date object are that it only supports the user's local time and UTC, and there's no time zone support. Additionally, its parsing behavior is very unreliable, and Date itself is mutable, which can introduce hard-to-trace bugs.
I also don't see how the parsing behaviour is unreliable (examples?)
Date being a mutable prototype is a positive, because it allows web devs to change it at will to cater to edge cases of Date or to add only those convenience functions that are needed for their use. What's bad about that?
This really does feel like a setup nobody asked for except those who want to control site scripting from the top down and from an implementation-first, client-code focused approach (i.e. Google Chrome).
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Fanatic
- Posts: 204
- Joined: 2015-06-04, 18:12
Re: Javascript Temporal - another feature no one asked for
I assumed that they talk about the Date objects themselves being mutable, not the prototype.
Code: Select all
var a = new Date();
// a is now: 2025-02-01T22:27:01.342Z
a.setFullYear(2020);
// a is now: 2020-02-01T22:27:01.342Z
Code: Select all
var a = Temporal.Now.plainDateTimeISO();
// a is now: 2025-02-01T22:27:01.342Z
var b = a.with({year: 2020});
// a is still the same as before, and b is now: 2020-02-01T22:27:01.342Z
-
- Pale Moon guru
- Posts: 37640
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: Javascript Temporal - another feature no one asked for
Even if they meant that the Date object is immutable, why would I want that? Forcing object juggling all the time is way worse than simply modifying it as-needed.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Lunatic
- Posts: 332
- Joined: 2017-11-18, 04:24
Re: Javascript Temporal - another feature no one asked for
Back when developing javascript, it was all annoying because it seemed like a toy language ... what with poor data typing and half-baked intrinsics + functions like Date-stuff. Previously-done work needs to yes be preserved, but also future work needs to be optimized for correctness / development speed. Compare against PHP, which started as a toy language and has grown significantly, without losing too much backward compatibility at one time. Agree most infrastructure changes these days are secretly intended to douse the positive reasons for internet to exist.
-
- Knows the dark side
- Posts: 5584
- Joined: 2015-12-09, 15:45
Re: Javascript Temporal - another feature no one asked for
PHP is sadly being abandoned for all the bloated frameworks developed against the latest Chrome canary.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net
-
- Fanatic
- Posts: 131
- Joined: 2020-04-22, 18:47
- Location: Marietta, Ohio, USA, North America, Western Hemisphere, Earth, Milky Way, Universe, Multiverse
Re: Javascript Temporal - another feature no one asked for
PHP is miserable as fuck. I don't consider its decline sad. Having to learn how to use PHP in order to fix a WordPress site was one of the most painful experiences I've ever had on a computer.
-
- Pale Moon guru
- Posts: 37640
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: Javascript Temporal - another feature no one asked for
You're entitled to your opinion, of course, but I think PHP is still miles better than running a full site on, say, Python or Java.daemonspudguy wrote: ↑2025-02-28, 15:59PHP is miserable as fuck. I don't consider its decline sad. Having to learn how to use PHP in order to fix a WordPress site was one of the most painful experiences I've ever had on a computer.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Fanatic
- Posts: 131
- Joined: 2020-04-22, 18:47
- Location: Marietta, Ohio, USA, North America, Western Hemisphere, Earth, Milky Way, Universe, Multiverse
Re: Javascript Temporal - another feature no one asked for
Do people actually run entire sites on Java or Python? That's a nightmare scenario for me. Web-based JVM is not a phrase that should exist.
-
- Moon Magic practitioner
- Posts: 2401
- Joined: 2018-05-05, 13:29
Re: Javascript Temporal - another feature no one asked for
People will try to run web applications on top of their own favourite languages. First Java, then Python, then Go, then Rust, then...daemonspudguy wrote: ↑2025-02-28, 18:53Do people actually run entire sites on Java or Python? That's a nightmare scenario for me. Web-based JVM is not a phrase that should exist.
-
- Knows the dark side
- Posts: 5584
- Joined: 2015-12-09, 15:45
Re: Javascript Temporal - another feature no one asked for
Server side Java started off as 'servlets' similar to applets - loaded by a servlet runner to which certain directory paths would be mapped, entirely within the process and security model of the webserver. Separately application servers like JBoss and Websphere were made, to run more complicated server side logic, and for a while there was also Java Server Pages, similar to Microsoft's Active Server Pages. It's a mature, secure and robust technology that delivers on the original Java promise of write once, run anywhere. You can port an old web application that ran on a Sun Solaris server to a modern application server running on whatever flavor of Linux or Windows today, without touching your legacy code. Note that I am referring to web applications, not web pages written with Javascript frameworks as is the fashion now.daemonspudguy wrote: ↑2025-02-28, 18:53Do people actually run entire sites on Java or Python? That's a nightmare scenario for me. Web-based JVM is not a phrase that should exist.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net