跳到主要内容

unsetWorkTime

Description

在甘特图中取消工作时间的设定

unsetWorkTime: (config: object) => void,

Parameters

  • config - (必填) object - 一个时间段的配置对象

Example

gantt.config.work_time = true;

// 将工作日的工作时间从 ["8:00-17:00"] 更新为 ["9:00-18:00"]
gantt.setWorkTime({ hours:["9:00-18:00"] });
// 移除工作时间配置
gantt.unsetWorkTime({ hours:["9:00-18:00"] });

Details

版本 4.1 中新增

配置对象属性

配置对象可以包含以下属性:

属性

描述

day 星期几的数字表示 [0 (星期日) - 6 (星期六)]. 注意一次只能设置一天
// 将所有星期一标记为非工作日
gantt.unsetWorkTime({ day:1, hours:false });
date 一个用于设定/取消工作时间的具体日期
// 将特定日期标记为休息日
gantt.unsetWorkTime({date:new Date(2013,0,1), hours:false})
hours 一个以 'from'-'to' 对形式表示的工作时间数组。
'false' 值用于取消工作时间,'true' (默认值) 应用默认工作时间(["8:00-17:00"])
// 移除星期五上午8:00到12:00的工作时间
gantt.unsetWorkTime({day : 5, hours : ["8:00-12:00"]});
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.