function getMonthName(monthNumber) {
const date = new Date();
date.setMonth(monthNumber - 1);
return date.toLocaleString([], { month: 'long' });
}
function getMonthName(monthNumber) {
const date = new Date();
date.setMonth(monthNumber - 1);
return date.toLocaleString([], { month: 'long' });
}
Why wouldn’t you just use the ruby functions for adding a month to a date?
https://ruby-doc.org/stdlib-2.5.1/libdoc/date/rdoc/Date.html#method-i-3C-3C
It seems really weird that there’s so much pushback against “date time math is tricky, read the manual to find out exactly which compromise your library chose”.