Open korkuttaha opened 7 years ago
Hi the reason because of this is quite simple you have a condition that say
if (idx < currentMonth ) {
$(this).css("display", "none");
}
Basically you're telling that if we're on February of whatever year it'll hide January, what you should do is just compare with current year and month number
Another way around is just load current year and avoid that the clients change years
is it possible for you to write that condition for me?.. :) if it would not be so much pain :)
Thanks in advance
Hello,
This code works for passed months but it disables passed months for 2018 aswell. It should disable January, February, March, April, May for 2017 but not for 2018
renderEnd: function (e) { var currentMonth = new Date().getMonth(); $('#calendar .month-container').each(function (idx, el) { if (idx < currentMonth) { $(this).css("display", "none"); } if (idx > currentMonth + 12) { $(this).css("display", "none"); } }); },
Thanks in advance