jquery - multidatespicker with disabled dates from php variable -
i'm trying holidays php function , using them disable dates multidatepicker.
using jquery multidatespicker from: http://multidatespickr.sourceforge.net/
//php: $holidays = show_holidays($year, $province); which $holidays echo's as:
['01/01/2014','02/17/2014','04/18/2014','05/19/2014,'07/01/2014','08/04/2014','09/01/2014','10/13/2014','12/25/2014','12/26/2014'] my js:
var holidays = "<?php echo $holidays; ?>"; $('#with-altfield').multidatespicker({ adddisableddates: holidays, altfield: '#vacationdays', beforeshowday: $.datepicker.noweekends }); and doesn't disable dates...
firebug shows error : uncaught exception: missing number @ position 0
sorry all, figured out... had put in array , remove [ ] php var:
changed:
var holidays = "<?php echo $holidays; ?>"; to
var holidays = [ <?php echo $holidays; ?> ]; and works now...
Comments
Post a Comment