I would like to highlight some custom dates: this is what I have so far
if ( jQuery('.datepicker').length ) {
jQuery('.datepicker').each(function (i) {
var $item = jQuery(this);
var fechas = $item.data('fechas');
var options = {
'display' : $item.data('display') == '' ? '' : $item.data('display'),
beforeShowDay: function(date) {
console.log(date);
if ( fechas.length ) {
for( var i = 0; i < fechas.length; i++ ) {
if ( fechas[i] == date) {
return [true, 'css-class-to-highlight', 'tooltipText'];
}
}
}
}
}
$item.datepicker( options );
});
}
But then I got this error
Uncaught TypeError: Cannot read property '0' of undefined
http://jsfiddle.net/34jLb8o3/2/
the thing is I want to highlight this dates, no matter the current date, I've seen answers like this one but I don't think they apply here, Does it?