jquery - Highlight custom dates in datepicker -


I would like to highlight some custom dates: this is what I have done so far

 < Code> if (jQuery ('datepicker'). Length) {jQuery ('datepicker'). Each (function (i) {var $ item = jQuery (this); var fechas = $ item.data ('fechas'); Var option = {'display': $ item.data ('display') == '' ? '': $ Item.data ('display'), first show: function (date) {console.log (date); if (Fechas.length) {for (var i = 0; i & lt; fechas.length ; I ++) {if (fechas [i] == date) {return, [CSS-class-to-highlight ',' tooltip text '];}}}}} $ Item.datepicker (option);}) ; }   

But then I got this error

  Uncort type type: property can not read '0' as unspecified   

It is a matter that I want to highlight these dates, no current date, I have seen the answer but I do not think they apply here, is it?

This seems to work better:

  jQuery (function ( ) {JQuery ('datepicker') .each (function (i) {var $ item = jQuery (this); var fechas = $ item.data ('fechas'); var option = {' dateFormat ':' dd / mm / Yy ',' display ': $ Item.data (' display ') ==' '?' ': $ Item.data (' display '), first show: function (date) {if (fechas.length) { Var datestr = [date.getDate (), Date.getMonth () + 1, date.getFullYear ()]; datestr = datestr.join ('/'); console.log (datestr); if ($ .inArray (datestr) , Fechas)! = -1) {Return [true, 'CSS-class to highlight', 'tooltip text'];} Other [return, 'CSS-normal-class', 'no-highlights'];}} }} $ MadDet Options);});});    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -