function getMonthName(monthNumber) {
const date = new Date();
date.setMonth(monthNumber - 1);
return date.toLocaleString([], { month: 'long' });
}
Post funny things about programming here! (Or just rant about your favourite programming language.)
The date API is like the original rip of the Java date API. Barely changed, and totally backwards compatible nonsense.
Temporal is the new JavaScript/ECMAScript date API.
It’s stage 3, and likely stable (just a few kinks being worked out). So you could polyfill it for production.
https://github.com/tc39/proposal-temporal
Speaking of Java RipS. How annoying is it the JS has left Java in the dust as far as looser standards?
Developing in Java: YOU FORGOT A SEMI-COLON ARE YOU CRAZY?! HOW IS THE COMPILER SUPPOSED TO KNOW WHAT TO DO?!
Developing in JS: Who gives a fuck about semi-colons?