MultiDatesPicker addDisabledDates

爱⌒轻易说出口 提交于 2019-12-02 09:54:20

问题


Error : Uncaught Missing number at position 0

php
$date_disabled = "'03/04/2015','03/10/2015'";

html
<input type="text" id="date" value="<?php echo $date_disabled; ?>" />

javascript
$(document).ready(function(){ 
    $('#booking_date').multiDatesPicker({
      addDisabledDates: [$('#date').val()]
    });
});

Just wondering if able to pull value from html input text to javascript like this? i'm not sure why is this error appearing...

if i set the value manually into the javascript than the multi date picker is running well without any problem.

$(document).ready(function(){
    $('#booking_date').multidatesPicker({
       addDisabledDates:['03/04/2015','03/10/2015']
    });
});

Thousand appreciate to anyone could help. :D


回答1:


Use this Demo here

var array = ["14-03-2015","17-03-2015","16-03-2015"]

$('input').datepicker({
    beforeShowDay: function(date){
        var string = jQuery.datepicker.formatDate('dd-mm-yy', date);
        return [ array.indexOf(string) == -1 ]
    }
});


来源:https://stackoverflow.com/questions/28852426/multidatespicker-adddisableddates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!