Flag that the calendar is being used as the default calendar.
Description.
Unique identifier (uuid).
Name.
Returns calendar days for the specified year.
Get working schedule (cycle).
By default, the business calendar can only have a weekly work schedule.Example:
// Get the default business calendar const workCalendar = await System.productionSchedule.workCalendars.getDefault(); // Fill out the weekly work schedule (loop) const workSchedule: WorkSchedule<'weekly'> = { type: 'weekly', cycle: [ { isWorkingDay: false, description: 'Sunday' }, { useDefault: true, description: 'Monday' } , { useDefault: true, description: 'Tuesday' }, { useDefault: true, description: 'Wednesday' }, { useDefault: true, description: 'Thursday' }, { useDefault: true, description: 'Friday' } , { isWorkingDay: false, description: 'Saturday' }, ], defaultDaySettings: { startAt: new TTime(9, 0, 0, 0), endAt: new TTime(18, 0, 0, 0), breaks: [ { startAt: new TTime(12, 0, 0, 0), endAt: new TTime(13, 0, 0, 0), description: 'Lunch break', }, ], isWorkingDay: true, isHolidayDay: false, }, }; // Apply the work schedule to the calendar workCalendar.setSchedule(workSchedule); // Save the business calendar await workCalendar.save();
Get associated calendar of exception days.
Unbind the celandar of exeption days.
Saves changes in the calendar.
Set working schedule (cycle).
Bind a calendar of exception days.
Your review is successfully sent!
Feedback sent successfully
Default business calendar
Hierarchy
Properties
Readonly default
Flag that the calendar is being used as the default calendar.
Optional description
Description.
Readonly id
Unique identifier (uuid).
name
Name.
Methods
getDays
Returns calendar days for the specified year.
Parameters
from: TDate
to: TDate
Optional startAt: TDate
Returns Promise<readonly Readonly<WorkCalendarDay>[]>
Returns calendar days for the specified year.
Parameters
year: number
Optional startAt: TDate
Returns Promise<readonly Readonly<WorkCalendarDay>[]>
getSchedule
Get working schedule (cycle).
By default, the business calendar can only have a weekly work schedule.
Example:
// Get the default business calendar const workCalendar = await System.productionSchedule.workCalendars.getDefault(); // Fill out the weekly work schedule (loop) const workSchedule: WorkSchedule<'weekly'> = { type: 'weekly', cycle: [ { isWorkingDay: false, description: 'Sunday' }, { useDefault: true, description: 'Monday' } , { useDefault: true, description: 'Tuesday' }, { useDefault: true, description: 'Wednesday' }, { useDefault: true, description: 'Thursday' }, { useDefault: true, description: 'Friday' } , { isWorkingDay: false, description: 'Saturday' }, ], defaultDaySettings: { startAt: new TTime(9, 0, 0, 0), endAt: new TTime(18, 0, 0, 0), breaks: [ { startAt: new TTime(12, 0, 0, 0), endAt: new TTime(13, 0, 0, 0), description: 'Lunch break', }, ], isWorkingDay: true, isHolidayDay: false, }, }; // Apply the work schedule to the calendar workCalendar.setSchedule(workSchedule); // Save the business calendar await workCalendar.save();Returns Readonly<WorkSchedule<"weekly", CalendarScheduleDaySettings>>
getSpecialCalendar
Get associated calendar of exception days.
Returns Promise<SpecialCalendar | undefined>
resetSpecialCalendar
Unbind the celandar of exeption days.
Returns void
save
Saves changes in the calendar.
Returns Promise<void>
setSchedule
Set working schedule (cycle).
Parameters
schedule: WorkSchedule<"weekly">
Returns void
setSpecialCalendar
Bind a calendar of exception days.
Parameters
calendar: SpecialCalendar
Returns void
Feedback sent successfully
Thank you for your input