Hierarchy
-
BaseWorkCalendar
- DefaultWorkCalendar
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
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
-
Default business calendar