Framework7 Datepicker Modify Events After Initializing
Hello Framework7 team, How do we modify (renew) the events after initializing for example on a month change (onMonthYearChangeStart) ? var today = new Date(); var weekLater = new D
Solution 1:
I ended up looping through the events and added/removed classes to the date object like below: So with every month change I called the following script. I also used a minus and a plus class to get red and green dots.
eventsPlusDataValues = dataSet.map(function(a) {
if(a.hasValue && a.value > 0)$("[data-date="+a.startDate+"]").addClass('picker-calendar-day-has-events').removeClass('picker-calendar-day-has-eventsMinus').addClass('picker-calendar-day-has-eventsPlus');
if(a.hasValue && a.value < 0)$("[data-date="+a.startDate+"]").addClass('picker-calendar-day-has-events').removeClass('picker-calendar-day-has-eventsPlus').addClass('picker-calendar-day-has-eventsMinus');
return a.startDate;
});
It is a while back so I hope I did not forget something.
Post a Comment for "Framework7 Datepicker Modify Events After Initializing"