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 QT6颜色选择对话框显示不完整
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下