jquery - Highlight an array of dates in PickMeUp plugin -


i using pickmeup js calendar plugin in project.

the problem i'm having want able let user select multiple dates while, simultaneously, displaying pre-selected dates server-side database. however, not able work: pickmeup doesn't seem have such option.

does know how can highlight given set of dates in datepicker?

this possible.

what need load dates database array. can check array pickmeup's object render event , check every date against dates array. if of dates coincide, return event class_name new css class. can use css class highlight dates database.

for example, following javascript/jquery illustrates mean:

// creating 'sample' dates (you load database instead) var datesfromdatabase = []; var d = new date(); (i = 2; < 7; i++) {     var tempday = new date(); tempday.sethours(0,0,0,0);     tempday.setdate(d.getdate()-i);     datesfromdatabase.push(tempday.gettime()); }  $(function () {     $('.multiple').pickmeup({         flat: true,         mode: 'multiple',         // before rendering dates, highlight if database         render: function(date) {             if ($.inarray(date.gettime(), datesfromdatabase) > -1){                 return {                     class_name : 'highlight'                 }             }         }     }); }); // little hack deselect current day: pickmeup forces have default date :( $('.pmu-today').click(); 

with following css:

.highlight:not(.pmu-today) {     background: #8fc490; } .highlight:not(.pmu-today):hover {     background: #136a9f !important; } 

demo


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -