【问题标题】:How to add recurring events pragmatically in DHTMLX Scheduler?如何在 DHTMLX 调度程序中实用地添加重复事件?
【发布时间】:2018-08-07 17:42:00
【问题描述】:

我想将此活动添加到我的日历中

let eventID = scheduler.addEvent({
                        start_date: "2018-03-03 10:00:00",
                        end_date: "2018-03-10 11:00:00",
                        text: "words",
                        details: "",
                        rec_type: "week_1___1,2",
                    });

但是,当我运行这部分代码时,我在 dhtmlxscheduler.js 中遇到错误 Cannot read property 'valueOf' of undefined。将事件添加为重复事件的正确方法是什么。我为重复事件添加了依赖 js 文件,并在我的 init 中指定了以下内容

    scheduler.config.details_on_create=true;
    scheduler.config.details_on_dblclick=true;
    scheduler.config.include_end_by = true;
    scheduler.config.repeat_precise = true;        
    var today = new Date(); 
    scheduler.init('scheduler_here',today, "week"); 

【问题讨论】:

    标签: javascript dhtml dhtmlx


    【解决方案1】:

    如果您将 addEvent 用于重复事件,则 start/end_date 属性的值必须具有 Date 类型:

    let eventID = scheduler.addEvent({
      id: '1',
      start_date: new Date(2018, 2, 3, 10), 
      end_date:   new Date(2018, 2, 10, 11),      
      text:"words",
      details: "",
      rec_type: "week_1___1,2",
      event_pid: "0",
      event_length: 60*60*4
    })
    

    【讨论】:

      猜你喜欢
      • 2015-03-30
      • 2018-05-25
      • 2021-10-18
      • 2019-09-30
      • 2012-11-23
      • 2019-07-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多