jquery - DIsable multiple dates in pickadate.js -


i working pickadate in application. here store holidays dynamically in database. fetching dates gem 'gon'.

gon.holidays = @holidays.collect { |holiday| [holiday.date] } 

in application.js

 alert(gon.holidays); 

output is

when load page alert gives output

to disable dates in pickadate. followed

$( '.new_leave_datepicker' ).pickadate({         selectmonths: true,         selectyears: 25,         disable: [            new date([2015,06,22]),             new date([2015,06,23])         ],         min: date.now()     }); 

when entered these static values pickadate disable these dates want disable dates coming gon gem. please guide me how use each function of jquery this. in advance

hi please try may out

var dates = $( '.new_leave_datepicker' ).pickadate();     picker = dates.pickadate('picker');     jquery.each(gon.holidays, function( val ){         var newdate = new date(val);             disabledate = picker.get("disable", [newdate]);     }); 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -