Answer the question
In order to leave comments, you need to log in
How to return month name from month number?
Welcome to the HABR Internet portal! And... But fuck these conventions, SHORTER: when I try to convert the month number into a name, I don't get the month! What to rob?
Here is the code:
let date = "2020-08-30 21:00:00";
let month = Number(date.slice(5,7));
day_temp.textContent = Math.floor(data['list'][0]['main']['temp']) - 273 + "°";
day_date.textContent = month.toLocaleString('default', {month: 'long'});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question