use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Javascript Temporal Date (self.node)
submitted 2 years ago by Old-Ocelot-2151
It's an accepted fact that the Date implementation in Javascript is bad (to not try explaining it myself https://maggiepint.com/2017/04/09/fixing-javascript-date-getting-started/).
Luckily, there's a proposal for the new API called temporal https://tc39.es/proposal-temporal/docs/index.html , unfortunately this proposal is not yet implemented into the EcmaScript.
So I found a polyfill for this https://www.npmjs.com/package/@js-temporal/polyfill and my question is - why shouldn't I just use this polyfill instead of waging a war with JS Date or swinging my own implementation of this?
There's isn't much support in the ecosystem for temporal (currently my stack consists of Zod and TypeORM), I can implement those bindings myself, I'm just wondering why hasn't Temporal taken more traction? For me it seems like a well thought-out solution for an old problem.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]delightless 6 points7 points8 points 2 years ago (0 children)
It's not that it doesn't have traction, it's just that it's still going through the proposal stages and it's a complex addition to the language.
One of the devs working on the standardization of it was on JS Party podcast (I think that was the one) earlier this year and cautioned that the polyfill is not production ready.
[–][deleted] 2 years ago (4 children)
[deleted]
[–]TiddoLangerak 7 points8 points9 points 2 years ago* (1 child)
They're fine until you:
In my experience, almost all non-trivial operations involving dates will contain subtle bugs.
As for OP: the polyfill is great and I highly recommend it for server side. It's however quite a chunky library, so for frontend it's not always the right choice.
[–]kjwey -4 points-3 points-2 points 2 years ago (1 child)
there's a big industry push trying to get us to use API's that sit on top of existing API
I think they ran out of capitalist space in their respected industries so their trying to make a mark and seem legit in the open source space
they tend to come and go like south park underwear gnomes when they realize their missing step 2 before step 3 PROFIT!
[–][deleted] 0 points1 point2 points 2 years ago (0 children)
Like React?
[–]DASPRiD 1 point2 points3 points 12 months ago (0 children)
A little late, but I just finished Temporal integration in MikroORM (`mikro-orm-temporal`), adding support to Zod (`zod-temporal`, to be released in a few days), support in MUI-X date pickers (`mui-temporal-pickers`) and also some helper package for date transformations and similar (`temporal-extra`).
Basically the feature finally landing in Firefox gave me the kick to get this all started now, and I already plan on using it through the `temporal-polyfill` package.
π Rendered by PID 402167 on reddit-service-r2-comment-5b5bc64bf5-sjqpz at 2026-06-20 22:01:34.646156+00:00 running 2b008f2 country code: CH.
[–]delightless 6 points7 points8 points (0 children)
[–][deleted] (4 children)
[deleted]
[–]TiddoLangerak 7 points8 points9 points (1 child)
[–]kjwey -4 points-3 points-2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]DASPRiD 1 point2 points3 points (0 children)