Answer the question
In order to leave comments, you need to log in
How to display the day of the week and month given the ordinal number of the day of the year?
Let's say I write 34 and outputs - February 3 day of the week Sun .....
With the help of if else it turns out but the whole lecture)) In theory, it is necessary to do it in cycles, but how?
Answer the question
In order to leave comments, you need to log in
function dateFromDay(year, day){
const date = new Date(year, 0);
return new Date(date.setDate(day));
}
dateFromDay(2019, 34); // Sun Feb 03 2019 00:00:00 GMT+0300 (Москва, стандартное время)
https://learn.javascript.ru/datetime Read first about JS date and time to understand what's going on. These are not libraries) Everything has already been done extremely simply, no conditions are needed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question