The type of metadata stored in the schedule.
Creates a schedule based on the given input.
The input which describes the schedule of events.
A set of identifiers which mark what days, times, weeks, months, etc that should have all event occurrences cancelled.
The array of frequency functions which had valid frequencies.
How frequent the event occurs based on Day.day.
How frequent the event occurs based on Day.dayOfMonth.
How frequent the event occurs based on Day.dayOfWeek.
How frequent the event occurs based on Day.dayOfYear.
The length of events in this schedule.
The number of days an event in this schedule lasts PAST the starting day. If this is a full day event with a duration greater than zero this value will be greater than one. If this event occurs at a specific time with a given duration that is taken into account and if it passes over into the next day this value will be greater than one. This value is used to look back in time when trying to figure out what events start or overlap on a given day.
The unit which describes the duration of the event.
The latest an event can occur in the schedule, or null
if there are no
restrictions when the latest event can occur. This day is inclusive.
A set of identifiers which mark what days or times are excluded on the schedule. This typically represents the set of event occurrences removed.
How frequent the event occurs based on Day.fullWeekOfMonth.
How frequent the event occurs based on Day.fullWeekOfYear.
A set of identifiers which mark what days or times are included outside the normal series of days on the schedule. This typically represents an event occurrence which is moved so its added to the exclude and include sets.
How frequent the event occurs based on Day.lastDayOfMonth.
How frequent the event occurs based on Day.lastFullWeekOfMonth.
How frequent the event occurs based on Day.lastFullWeekOfYear.
How frequent the event occurs based on Day.lastWeekspanOfMonth.
How frequent the event occurs based on Day.lastWeekspanOfYear.
A map of metadata keyed by an identifier. The metadata is placed in CalendarEvent.
How frequent the event occurs based on Day.month.
How frequent the event occurs based on Day.quarter.
The earliest an event can occur in the schedule, or null
if there are no
restrictions when the earliest event can occur. This day is inclusive.
The times at which the events occur on the days they should. If there are no times specified its assumed to be an all day event - potentially over multiple days or weeks based on Schedule.duration and Schedule.durationUnit.
How frequent the event occurs based on Day.week.
How frequent the event occurs based on Day.weekOfMonth.
How frequent the event occurs based on Day.weekOfYear.
How frequent the event occurs based on Day.weekspanOfMonth.
How frequent the event occurs based on Day.weekspanOfYear.
How frequent the event occurs based on Day.year.
The Identifier for this schedule. Either Identifier.Day or Identifier.Time.
Returns the last event time specified or undefined
if this schedule is
for an all day event.
The maximum number of occurrences allowed in the Schedule. Schedule.start is required and Schedule.end is ignored and overwritten. This is an expensive check and should be avoided if possible. If this value is less than 1 it is ignored.
Adjusts the Schedule.start and Schedule.end dates specified on this
schedule if this schedule represents a single event and the start
and
end
are already set or addSpan
is true
.
If true
, the start
and end
dates will always be
adjusted if this schedule is a single event.
Clones this schedule.
A new schedule which matches this schedule.
Determines if the given day is covered by this schedule. A schedule can specify events that span multiple days - so even though the day does not match the starting day of a span - it can be a day that is within the schedule.
The day to test.
true
if the day is covered by an event on this schedule,
otherwise false
.
Determines if the given timestamp lies in an event occurrence on this schedule.
The timestamp to test against the schedule.
true
if the timestamp lies in an event occurrent start and end
timestamps, otherwise false
.
Describes the schedule in a human friendly string taking into account all possible values specified in this schedule.
A brief description of the things (events) on the schedule.
When true
the Schedule.start and Schedule.end
are possibly included in the description if they have values.
When true
the Schedule.times are possibly included
in the description.
When true
the Schedule.duration and
Schedule.durationUnit are added to the description if
Schedule.duration is not equal to 1
.
When true
the Schedule.exclude are added
to the description if there are any.
When true
the Schedule.include are added
to the description if there are any.
When true
the Schedule.cancel are added
to the description if there are any.
The descroption of the schedule.
Creates a forecast for this schedule which returns a number of event occurrences around a given day. A single item could be returned per day, or you could get an item for each timed event occurrence.
The day to find a forecast around.
If true
spans which span multiple days will be looked at
to see if they intersect with the given day, otherwise false
will
only look at the given day for the start of events.
The number of events to return after the given day.
The number of events to return before the given day.
If timed events should be returned, or only one for each day.
How many days to look before and after the given day for event occurrences.
A new iterator which provides the event occurence span, the day it
starts (or is covered if covers
is true
), and the identifier for the
event.
Gets the end date of the schedule. Even if one is not specified, one can be calculated if this is a single event schedule.
Estimates the maximum number of prop
from the start date that events
could be happening. If the start date is not specified -1 will be
returned representing potentially infinite prop
s. If specific prop
s
are specified the difference between the maximum prop
and the start prop
will be returned. After that if Schedule.maxOccurrences is not
specified -1 will be returned unless the end date is specified. In that
case the prop
s between the start and end are returned. Otherwise
if events occur every X prop
s then that calculation is used taking into
account Schedule.maxOccurrences. Finally no year rule is specified
so worst case is assumed, Schedule.maxOccurrences.
The returned value is always rounded up, so if the first and last
occurrence happens the same prop
1 will be returned.
Returns the metadata for the given day or null
if there is none.
The day to return the metadata for.
The data to return if none exists for the given day.
lookAtTime If the specific time of the given day should be looked at.
The metadata or null
.
Returns all metadata for the given day or an empty array if there is none.
The day to return the metadata for.
The array of metadata ordered by priority or an empty array.
Returns an iterator for all occurrences in this schedule. If a finite list of occurrences is not possible to generate, an empty iterator will be returned. A finite set of occurrences can be determine when a start and end date are specified.
Attempts to calculate the entire range of the schedule taking into account any start date, end date, the included and excluded dates, and also even if the start and end date aren't specified, it checks to see if this is a single event schedule. If the start of the result is not defined, that means this schedule has occurred since the beginning of time. If the end of the result is not defined, that means the schedule will occurr until the end of time.
Returns the span of the single event in this schedule if it's that type of
schedule, otherwise null
is returned.
A span of the single event, otherwise null
.
Gets the start date of the schedule. Even if one is not specified, one can be calculated if this is a single event schedule.
Determines whether the given day has events added through Schedule.include.
The day to look for included times on.
true
if there are included event instances on the given day,
otherwise false
.
Determines whether the given day is cancelled in the schedule.
The day to test.
lookAtTime If the specific time of the given day should be looked at.
true
if the day was cancelled, otherwise false
.
Determines whether the given day is explicitly excluded in the schedule.
The day to test.
lookAtTime If the specific time of the given day should be looked at.
true
if the day was excluded, otherwise false
.
Returns whether the events in the schedule are all day long or start at
specific times. Full day events start at the start of the day and end at
the start of the next day (if the duration = 1
and durationUnit = 'days').
Full day events have no times specified and should have a durationUnit of
either days
or weeks
.
Determines whether the given day is fully excluded from the schedule. A fully excluded day is one that has a day-wide exclusion, or the schedule is not an all-day event and all times in the schedule are specifically excluded.
The day to test.*
true
if he day is fully excluded, otherwise false
.
Determines whether the given day is explicitly included in the schedule.
The day to test.
lookAtTime If the specific time of the given day should be looked at.
true
if the day is NOT explicitly included, otherwise false
.
true
if this schedule produces events only in a specific day of
the month.
true
if this schedule produces events only in a specific day of
the week.
true
if this schedule produces events only in a specific day of
the year.
Determines whether this schedule produces a single event, and no more. If this schedule has any includes, it's assumed to be a multiple event schedule. A single event can be detected in the following scenarios where each frequency has a single occurrence (see Schedule.isSingleFrequency).
true
if this schedule produces a single event, otherwise false
.
Determines if the given FrequencyCheck results in a single occurrence.
true
if the frequency results in a single event, otherwise false
.
true
if this schedule produces events only in a specific month.
true
if this schedule produces events only in a specific week of
the month.
true
if this schedule produces events only in a specific week of
the year.
true
if this schedule produces events only in a specific year.
Iterates over days that events start in the schedule given a day to start, a maximum number of days to find, and a direction to look.
The day to start to search from.
The maximum number of days to iterate.
If true
this searches forward, otherwise false
is backwards.
If the given day should be included in the search.
The maximum number of days to look through from the given day for event occurrences.
A new Iterator for the days found in the cast.
Iterates timed events that were explicitly specified on the given day. Those events could span multiple days so may be tested against another day.
The day to look for included timed events.
The day to test against the timed event.
A new Iterator for all the included spans found.
Iterates through the spans (event instances) that start on or covers the given day.
The day to look for spans on.
If true
spans which span multiple days will be looked at
to see if they intersect with the given day, otherwise false
will
only look at the given day for the start of events.
A new Iterator for all the spans found.
Determines whether the given day is a day on the schedule for the start
of an event. If an event is more than one day and the day given is not the
start this may return false
. This does not test for event instances
that exist through Schedule.include.
The day to test.
true
if the day marks the start of an event on the schedule.
Determines whether the given day lies between the earliest and latest valid day in the schedule.
The day to test.
true
if the day lies in the schedule, otherwise false
.
Determines if the given day is on the schedule and the time specified on the day matches one of the times on the schedule.
The day to test.
true
if the day and time match the schedule, otherwise false.
Moves the event instance starting at fromTime
to toTime
optionally
placing meta
in the schedules metadata for the new time toTime
.
If this schedule has a single event (Schedule.isSingleEvent) then the
only value needed is toTime
and not fromTime
.
The timestamp of the new event.
The timestamp of the event on the schedule to move if this schedule generates multiple events.
true
if the schedule had the event moved, otherwise false
.
Moves the event instance starting at fromTime
to toTime
optionally
placing meta
in the schedules metadata for the new time toTime
. A move
is accomplished by excluding the current event and adding an inclusion of
the new day & time.
The timestamp of the event on the schedule to move.
The timestamp of the new event.
true
.
Moves the single event in this schedule to the given day/time if applicable.
If this schedule is not a single event schedule then false
is returned.
If this schedule is a timed event the time will take the time of the given
toTime
of takeTime
is true
.
The time to move the single event to.
If this schedule has a single timed event, should the time
of the event be changed to the time of the given toTime
?
true
if the schedule was adjusted, otherwise false
.
Moves a time specified in this schedule to the given time, adjusting any cancelled event instances, metadata, and any excluded and included event instances.
true
if time was moved, otherwise false
.
Finds the next day an event occurs on the schedule given a day to start, optionally including it, and a maximum number of days to look ahead.
The day to start to search from.
If the given day should be included in the search.
The maximum number of days to look ahead from the given day for event occurrences.
The next day on the schedule or null
if none exists.
Finds the next specified number of days that events occur on the schedule given a day to start, optionally including it, and a maximum number of days to look ahead.
The day to start to search from.
The maximum number of days to return in the result.
If the given day should be included in the search.
The maximum number of days to look ahead from the given day for event occurrences.
An array containing the next days on the schedule that events start or an empty array if there are none.
Finds the previous day an event occurs on the schedule given a day to start, optionally including it, and a maximum number of days to look behind.
The day to start to search from.
If the given day should be included in the search.
The maximum number of days to look behind from the given day for event occurrences.
The previous day on the schedule or null
if none exists.
Finds the previous specified number of days that events occur on the schedule given a day to start, optionally including it, and a maximum number of days to look behind.
The day to start to search from.
The maximum number of days to return in the result.
If the given day should be included in the search.
An array containing the previous days on the schedule that events start or an empty array if there are none.
Removes the time from this schedule and all related included, excluded, cancelled instances as well as metadata.
The time to remove from the schedule.
If any included instances should be removed as well.
true
if the time was removed, otherwise false
.
Sets the schedule with the given input.
The input or schedule which describes the schedule of events.
A function to use when parsing meta input into the desired type.
Changes the cancellation status of the event at the given start time. By
default this cancels the event occurrence - but false
may be passed to
undo a cancellation.
The start time of the event occurrence to cancel or uncancel.
Whether the event should be cancelled.
Changes the exclusion status of the event at the given time. By default
this excludes this event - but false
may be passed to undo an exclusion.
The start time of the event occurrence to exclude or include.
Whether the event should be excluded.
Sets the frequency for the given property. This does not update the Schedule.checks array, the Schedule.updateChecks function needs to be called.
The frequency to update.
The new frequency.
Sets whether this schedule is a full day event if it is not already. If
this schedule is a full day event and false
is passed to this function
a single timed event will be added based on defaultTime
. If this schedule
has timed events and true
is passed to make the schedule full day, the
timed events are removed from this schedule. If the durationUnit is not the
expected unit based on the new full day flag - the duration is reset to 1
and the duration unit is set to the expected unit.
Whether this schedule should represent a full day event or timed events.
If fullDay
is false
and this schedule is currently
a full day event - this time will be used as the time of the first event.
Converts the schedule instance back into input.
When true
the start, end, and array of exclusions will
have Day instances, otherwise the UTC timestamp and dayIdentifiers
will be used when false
.
When true
the times returned in the input will be
instances of Time otherwise the timeFormat
is used to convert the
times to strings.
The time format to use when returning the times as strings.
If the duration values (duration
and
durationUnit
) should always be returned in the input.
If end should be in the input even if maxOccurrences is specified on the schedule.
The input that describes this schedule.
Updates Schedule.checks based on the frequencies that were specified in the schedule input.
Updates the Schedule.durationInDays variable based on the Schedule.lastTime (if any), the Schedule.duration and it's Schedule.durationUnit.
Updates the Schedule.end based on Schedule.maxOccurrences
Generates a schedule for an event which occurs once all day for a given day optionally spanning multiple days starting on the given day.
The day the event starts.
The number of days the event lasts.
A new schedule that starts on the given day.
Generates a schedule for an event which occurs once at a given time on a given day optionally spanning any amount of time (default is 1 hour).
The day the event starts.
The time the event starts.
The duration of the event.
The unit for the duration of the event.
A new schedule that starts on the given day and time.
Generated using TypeDoc
A class which describes when an event occurs over what time and if it repeats.