I'm a beginner in Javascript.
I need to make a calendar that shows only the months.
For example:
We are in September. The calendar will show from September (2016) to August (2017).
With the code below, I can print the months from January to December. But I need him to show from the current month up to 12 months ahead. Can you help me?
window.onload = function calendar() {
var a = new Date();
var b = a.getMonth();
var months = [
"Janeiro",
"Fevereiro",
"Março",
"Abril",
"Maio",
"Junho",
"Julho",
"Agosto",
"Setembro",
"Outubro",
"Novembro",
"Dezembro"
];
var i = months[i];
for (i = 0; i <= 11; i++) {
document.getElementsByClassName("month-time")[i].innerHTML = months[i];
}
}