Update Datepicker Tooltip In Beforeshowday
I have a JQuery Datepicker where I'm highlighting dates and adding text to the tooltip successfully. I have something very similar to this tutorial. The issue I'm having is if ther
Solution 1:
The problem you're getting comes from your first few lines:
varSelectedDates = {};
SelectedDates[newDate('04/05/2014')] = 'event1';
SelectedDates[newDate('04/05/2014')] = 'event2';
SelectedDates[newDate('04/07/2014')] = 'event3';
SelectedDates[newDate('04/07/2014')] = 'event4';
Here you're saving 'event1'
into SelectedDates
, then saving 'event2'
into the same spot, overwriting the data. What you could do instead is something like this:
SelectedDates[newDate('04/05/2014')] = ['event1'];
SelectedDates[newDate('04/05/2014')].push('event2');
SelectedDates[newDate('04/07/2014')] = ['event3'];
SelectedDates[newDate('04/07/2014')].push('event4');
Obviously, you could simplify this to:
SelectedDates[newDate('04/05/2014')] = ['event1','event2'];
SelectedDates[newDate('04/07/2014')] = ['event3','event4'];
Or whatever makes you most happy.
This will create an array at each specific date with all the events, and the tooltip will then contain each event. Here is an updated fiddle to show you the results: Click Here.
Hopefully this helps!
Post a Comment for "Update Datepicker Tooltip In Beforeshowday"