import { TimeZone } from "../imports/TimeZone"; import { GlideDateTime } from "./GlideDateTime"; import { GlideDuration } from "./GlideDuration"; import { GlideRecord } from "./GlideRecord"; import { GlideScheduleDateTimeSpan } from "./GlideScheduleDateTimeSpan"; import { GlideScheduleTimeMap } from "./GlideScheduleTimeMap"; import { GlideScheduleTimeSpan } from "./GlideScheduleTimeSpan"; export declare class GlideSchedule { constructor(); constructor(s: GlideSchedule); constructor(sysID: string); constructor(sysID: string, timeZone: string); constructor(sysID: string, adjustForLastSecondOfDay: boolean); /** * Adds a new schedule segment to the current schedule */ add(startDate: GlideDateTime, offset: GlideDuration): GlideDateTime; add( startDate: GlideDateTime, offset: GlideDuration, timeZone: string ): GlideDateTime; addOtherSchedule0( otherSchedule: GlideSchedule, includeFlag: boolean ): GlideSchedule; addTimeSpan(grSpan: GlideRecord): GlideScheduleTimeSpan; addTimeSpans(grSpans: GlideRecord): void; addTimeSpansExcluded(grSpans: GlideRecord): void; /** * Determines the elapsed time in the schedule between two date time values using the timezone of the schedule or, * if that is not specified, the timezone of the session */ duration(startDate: GlideDateTime, endDate: GlideDateTime): GlideDuration; duration( startDate: GlideDateTime, endDate: GlideDateTime, timeZone: string ): GlideDuration; excludeTimeSpan(grSpan: GlideRecord, timeZone: string): void; fetchTimeMap( startDate: GlideDateTime, endDate: GlideDateTime, timeZone: string, compressTimeMap: boolean ): GlideScheduleTimeMap; fetchTimeMapWithExcludes( startDate: GlideDateTime, endDate: GlideDateTime, timeZone: string, compressTimeMap: boolean ): GlideScheduleTimeMap; getDaysOfWeek(): string; getDaysOfWeekIgnoringExcludedSpans(): string; getID(): string; /** * Gets the current schedule name */ getName(): string; getSpans( startDate: GlideDateTime, endDate: GlideDateTime ): Array; getTZ(): TimeZone; getTimeMap( startDate: GlideDateTime, endDate: GlideDateTime ): GlideScheduleTimeMap; getTimeMap( startDate: GlideDateTime, endDate: GlideDateTime, timeZone: string ): GlideScheduleTimeMap; getTimeZone(): string; isInSchedule(time: GlideDateTime): boolean; isInSchedule(time: GlideDateTime, timeZone: string): boolean; /** * Determines if the current schedule is valid. A schedule is valid if it has at least one schedule span */ isValid(): boolean; /** * Loads a schedule with the schedule information. If a timezone is not specified or is nil, the current session * timezone is used for the schedule */ load(sysID: string): void; load(sysID: string, timeZone: string): void; load(sysID: string, timeZone: string, excludeSpanID: string): void; overlapsWith(spanGR: GlideRecord, timeZone: string): GlideScheduleTimeMap; overlapsWithAfterStart( spanGR: GlideRecord, timeZone: string, startGDT: GlideDateTime ): GlideScheduleTimeMap; /** * Sets the timezone for the current schedule */ setTimeZone(tz: string): void; whenLast(time: GlideDateTime): number; whenNext(): number; whenNext(time: GlideDateTime): number; whenNext(time: GlideDateTime, timeZone: string): number; }