自定义日历
GanttView.Calendars
说明
可读写
自定义日历。
返回值
javascript
{
isDefault?: boolean, // 是否为默认日历
name?: string, // 日历名称(暂不支持指定)
locality?: number, // 地区编码
weekend?: number[], // 值为0-6其中之一 (6,0代表周六、周日)
customWorkday?: number[], // 同上
customHoliday?: number[], // 同上
ignoreLawHoliday?: boolean, // 是否忽略法定节假日
}
浏览器环境示例
javascript
async function example() {
await instance.ready();
const app = instance.Application;
const ganttView = await app.Sheets(1).Views(1);
console.log(ganttView.Calendars);
ganttView.Calendars =
{
isDefault: true,
name: '自定义日历',
locality: 156,
weekend: [6, 0],
customWorkday: [1, 2, 3, 4, 5],
customHoliday: [],
ignoreLawHoliday: true,
}
}
脚本编辑器 示例
javascript
function main() {
const ganttView = Application.Sheets(1).Views(1);
console.log(ganttView.Calendars);
ganttView.Calendars =
{
isDefault: true,
name: '自定义日历',
locality: 156,
weekend: [6, 0],
customWorkday: [1, 2, 3, 4, 5],
customHoliday: [],
ignoreLawHoliday: true,
}
}
main();