this post was submitted on 31 Jul 2023
3 points (71.4% liked)

JavaScript

32 readers
1 users here now

Place for discussing all things related to the Javascript. This category can be used to ask for help with specific problems, share tips and tricks for working with js, and discuss new developments and best practices in the world of Javascript programming.

founded 2 years ago
 

It is now common knowledge that in 1995 Brendan was given only 10 days to write the JavaScript language and get it into Netscape. Date handling is a fundamental part of almost all programming languages, and JavaScript had to have it. That said, it’s a complex problem domain and there was a short timeline. Brendan, under orders to “make it like Java” copied the date object from the existing, infant, java.Util.Date date implementation. This implementation was frankly terrible. In fact, basically all of it’s methods were deprecated and replaced in the Java 1.1 release in 1997. Yet we’re still living with this API 20 years later in the JavaScript programming language. ~ https://maggiepint.com/2017/04/09/fixing-javascript-date-getting-started/

#javascript

top 4 comments
sorted by: hot top controversial new old
[–] candyman337 1 points 1 year ago (1 children)

GOD the date library in Javascript is atrocious, genuinely it is borderline useless. God bless momentjs

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago) (2 children)

@candyman337
Momentjs is deprecated and discouraged to use in production. Temporal is something to go to in future.

https://www.youtube.com/watch?v=oOK3UzLJ_Cs

List of alternatives to momentjs from momentjs' team:
https://momentjs.com/docs/#/-project-status/recommendations/

[–] candyman337 1 points 1 year ago

I belive day js uses all the same functions or was that luxon?

[–] candyman337 1 points 1 year ago* (last edited 1 year ago)

Yeah I know, but it was so good, I should have mentioned that though, so thanks for linking alternatives!