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

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
Post a Comment