Datepicker with multiple tagged days
published on
In one of my current Apex projects I have to show a mini calendar and mark certain days there. Unfortunately there is only the option to mark exactly one date in APEX. After a little Google research I came across the following article:
http://www.spiceforms.com/blog/highlight-particular-dates-jquery-ui-datepicker
So what is done here is the following:
- Fill array with date values (index as date and value = tooltip)
- Provide the data picker with a function that is executed before the picker itself is displayed.
- Provide CSS class and assign it to the days to be marked
To do this via APEX, I have adopted a pageprocess in Apex that runs before rendering the page:
Now I have my array. The next step was to use the Javascript method and create the CSS class. Runs…

But then came the problem. I could no longer select a date. The picker didn’t do anything about selecting a day. Accordingly, I couldn’t fire dependent events. After some debugging and testing, I finally managed it. In addition to the beforeShowDate method, you must also create the onSelect method. Probably my call overwrote them, so no onSelect event was fired.