I'm trying to create a calendar with Javascript to refresh, well I have a question.
Currently I get every day of every month with the following method.
function daysInMonth(month, year) {
return new Date(year, month, 0).getDate();
}
But I would like to know if there is any way to do the typical calendar, really the only thing that interests me is the format.
How could I print a calendar month knowing the days?
for(var i = 1; i < 13; i++) {
console.log(daysInMonth(i, years));
}
function daysInMonth(month, year) {
return new Date(year, month, 0).getDate();
}