I am not aware of an easy way to perform a function when hovering over a day with the jQuery UI datepicker so I am trying to do a work around by assigning a class and then calling a hover function:
$('.someDate').hover(function() { alert(this) } );
This does not work how I would like it though because it returns [object HTML TableCellElement]. How could I assign an attribute to each date cell td tag so that I can retrieve the date value through that method.
Or am i completely missing a really obvious way of doing this?
You can make use of the beforeShowDay event, which takes in the date object.
This will add a class of
date-DD-M-YYYYto each of the<td>.The function takes a
dateas a parameter and must return an array with:It is called for each day in the datepicker before it is displayed.
Read more at jQueryUI.com