dongshuming7131 2018-06-01 13:31
浏览 168
已采纳

如何在multiDatesPicker中设置选定的日期

I want to set selected dates in multiDatesPicker using php script which are comma separated values coming from the database. For example, this column 'Dates' having these values '02-05-2018, 15-05-2018, 27-05-2018'. How do I set/show these dates selected in multidatepicker.

<div id="myCalendar"></div>

$("#myCalendar").multiDatesPicker({

});
  • 写回答

1条回答 默认 最新

  • doupao1530 2018-06-01 23:49
    关注

    It's pretty easy, the MultiDatesPicker plugin exposes a method for setting values via the addDates method:

    $('#myCalendar').multiDatesPicker({
        addDates: ['5/2/2018','5/15/2018','5/27/2018','6/30/2018']
    });
    

    The addDates method (documentation) states that "the parameter dates can be a string, a date object or an array (of strings or javascript date objects)."

    Working jsFiddle here - you'll see June 30th selected as well as May 2nd, 15th & 27th. http://jsfiddle.net/bbrgx3pg/2/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 对于这个复杂问题的解释说明
  • ¥50 三种调度算法报错 采用的你的方案
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败