duandie0884 2017-03-30 08:41
浏览 124

jQuery日期选择器从文本文件中读取日期

I’m trying to read dates from a text file for example - '08/12/2017'

$.get('disableDays.txt', function(data) {
     var disableSpecificDays = data;

The values are getting read. I'm then trying to disable dates in the datepicker based on text file entries

It works when I set the value like this:

addDates: ['08/12/2017', '10/14/2017'],

This doesn’t work :

addDates:+ disableSpecificDays,

I’ve tried setting as array but I know jquery is not same as array and like:

addDates:+ $('#disableSpecificDays').val,

var today = new Date();
var y = today.getFullYear();
var dates = $('#full-year').multiDatesPicker({
            //addDates: ['08/12/2017', '10/14/2017'],
//addDates:+ $('#disableSpecificDays').val,
            addDates:+ disableSpecificDays,
                                    numberOfMonths: [3,4],
                                    defaultDate: '1/1/'+y                               
                            beforeShowDay: $.datepicker.noWeekends
                            });

What I am doing wrong?

Can I write back to the text file with:

file_put_contents($file, $current);
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
    • ¥50 汇编语言除法溢出问题
    • ¥65 C++实现删除N个数据列表共有的元素
    • ¥15 Visual Studio问题
    • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
    • ¥20 求一个html代码,有偿
    • ¥100 关于使用MATLAB中copularnd函数的问题
    • ¥20 在虚拟机的pycharm上
    • ¥15 jupyterthemes 设置完毕后没有效果
    • ¥15 matlab图像高斯低通滤波