DailyCalendar Class

Quartz.NET 3.0 API Documentation
This implementation of the Calendar excludes (or includes - see below) a specified time range each day.
Inheritance Hierarchy

SystemObject
  Quartz.Impl.CalendarBaseCalendar
    Quartz.Impl.CalendarDailyCalendar

Namespace:  Quartz.Impl.Calendar
Assembly:  Quartz (in Quartz.dll) Version: 3.0.0
Syntax

C#
[SerializableAttribute]
public class DailyCalendar : BaseCalendar

The DailyCalendar type exposes the following members.

Constructors

  NameDescription
Public methodDailyCalendar(DateTime, DateTime)
Create a DailyCalendar with a time range defined by the specified DateTimes and no baseCalendar. The Calendars are subject to the following considerations:
  • Only the time-of-day fields of the specified Calendars will be used (the date fields will be ignored)
  • The starting time must be before the ending time of the defined time range. Note this means that a time range may not cross daily boundaries (10PM - 2AM). (because only time fields are are used, it is possible for two Calendars to represent a valid time range and rangeStartingCalendar.after(rangeEndingCalendar) == true)
Public methodDailyCalendar(Int64, Int64)
Create a DailyCalendar with a time range defined by the specified values and no baseCalendar. The values are subject to the following considerations:
  • Only the time-of-day portion of the specified values will be used
  • The starting time must be before the ending time of the defined time range. Note this means that a time range may not cross daily boundaries (10PM - 2AM). (because only time value are are used, it is possible for the two values to represent a valid time range and rangeStartingTime > rangeEndingTime)
Protected methodDailyCalendar(SerializationInfo, StreamingContext)
Serialization constructor.
Public methodDailyCalendar(String, String)
Create a DailyCalendar with a time range defined by the specified strings and no baseCalendar. rangeStartingTime and rangeEndingTime must be in the format "HH:MM[:SS[:mmm]]" where:
  • HH is the hour of the specified time. The hour should be specified using military (24-hour) time and must be in the range 0 to 23.
  • MM is the minute of the specified time and must be in the range 0 to 59.
  • SS is the second of the specified time and must be in the range 0 to 59.
  • mmm is the millisecond of the specified time and must be in the range 0 to 999.
  • items enclosed in brackets ('[', ']') are optional.
  • The time range starting time must be before the time range ending time. Note this means that a time range may not cross daily boundaries (10PM - 2AM)
Public methodDailyCalendar(ICalendar, DateTime, DateTime)
Create a DailyCalendar with a time range defined by the specified DateTimes and the specified baseCalendar. The Calendars are subject to the following considerations:
  • Only the time-of-day fields of the specified Calendars will be used (the date fields will be ignored)
  • The starting time must be before the ending time of the defined time range. Note this means that a time range may not cross daily boundaries (10PM - 2AM). (because only time fields are are used, it is possible for two Calendars to represent a valid time range and rangeStartingCalendarUtc > rangeEndingCalendarUtc == true)
Public methodDailyCalendar(ICalendar, Int64, Int64)
Create a DailyCalendar with a time range defined by the specified values and the specified baseCalendar. The values are subject to the following considerations:
  • Only the time-of-day portion of the specified values will be used
  • The starting time must be before the ending time of the defined time range. Note this means that a time range may not cross daily boundaries (10PM - 2AM). (because only time value are are used, it is possible for the two values to represent a valid time range and rangeStartingTime > rangeEndingTime)
Public methodDailyCalendar(ICalendar, String, String)
Create a DailyCalendar with a time range defined by the specified strings and the specified baseCalendar. rangeStartingTime and rangeEndingTime must be in the format "HH:MM[:SS[:mmm]]" where:
  • HH is the hour of the specified time. The hour should be specified using military (24-hour) time and must be in the range 0 to 23.
  • MM is the minute of the specified time and must be in the range 0 to 59.
  • SS is the second of the specified time and must be in the range 0 to 59.
  • mmm is the millisecond of the specified time and must be in the range 0 to 999.
  • items enclosed in brackets ('[', ']') are optional.
  • The time range starting time must be before the time range ending time. Note this means that a time range may not cross daily boundaries (10PM - 2AM)
Public methodDailyCalendar(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
Create a DailyCalendar with a time range defined by the specified values and no baseCalendar. Values are subject to the following validations:
  • Hours must be in the range 0-23 and are expressed using military (24-hour) time.
  • Minutes must be in the range 0-59
  • Seconds must be in the range 0-59
  • Milliseconds must be in the range 0-999
  • The time range starting time must be before the time range ending time. Note this means that a time range may not cross daily boundaries (10PM - 2AM)
Public methodDailyCalendar(ICalendar, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
Create a DailyCalendar with a time range defined by the specified values and the specified baseCalendar. Values are subject to the following validations:
  • Hours must be in the range 0-23 and are expressed using military (24-hour) time.
  • Minutes must be in the range 0-59
  • Seconds must be in the range 0-59
  • Milliseconds must be in the range 0-999
  • The time range starting time must be before the time range ending time. Note this means that a time range may not cross daily boundaries (10PM - 2AM)
Top
Properties

  NameDescription
Public propertyCalendarBase
Set a new base calendar or remove the existing one
(Inherited from BaseCalendar.)
Public propertyDescription
Gets or sets the description given to the ICalendar instance by its creator (if any).
(Inherited from BaseCalendar.)
Public propertyInvertTimeRange
Indicates whether the time range represents an inverted time range (see class description).
Public propertyRangeEndingTime
Public propertyRangeStartingTime
Public propertyTimeZone
Gets or sets the time zone.
(Inherited from BaseCalendar.)
Top
Methods

  NameDescription
Public methodClone (Overrides BaseCalendarClone.)
Protected methodCloneFields (Inherited from BaseCalendar.)
Public methodEquals(Object) (Overrides BaseCalendarEquals(Object).)
Public methodEquals(BaseCalendar) (Inherited from BaseCalendar.)
Public methodEquals(DailyCalendar)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode (Overrides BaseCalendarGetHashCode.)
Public methodGetNextIncludedTimeUtc
Determine the next time (in milliseconds) that is 'included' by the Calendar after the given time. Return the original value if timeStamp is included. Return 0 if all days are excluded.
(Overrides BaseCalendarGetNextIncludedTimeUtc(DateTimeOffset).)
Public methodGetObjectData (Overrides BaseCalendarGetObjectData(SerializationInfo, StreamingContext).)
Public methodGetTimeRangeEndingTimeUtc
Returns the end time of the time range of the day specified in timeUtc
Public methodGetTimeRangeStartingTimeUtc
Returns the start time of the time range of the day specified in timeUtc.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsTimeIncluded
Determine whether the given time is 'included' by the Calendar.
(Overrides BaseCalendarIsTimeIncluded(DateTimeOffset).)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetTimeRange(DateTime, DateTime)
Sets the time range for the DailyCalendar to the times represented in the specified DateTimes.
Public methodSetTimeRange(Int64, Int64)
Sets the time range for the DailyCalendar to the times represented in the specified values.
Public methodSetTimeRange(String, String)
Sets the time range for the DailyCalendar to the times represented in the specified Strings.
Public methodSetTimeRange(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
Sets the time range for the DailyCalendar to the times represented in the specified values.
Public methodToString
Returns a String that represents the current Object.
(Overrides ObjectToString.)
Top
Remarks

For example, you could use this calendar to exclude business hours (8AM - 5PM) every day. Each DailyCalendar only allows a single time range to be specified, and that time range may not * cross daily boundaries (i.e. you cannot specify a time range from 8PM - 5AM). If the property InvertTimeRange is (default), the time range defines a range of times in which triggers are not allowed to * fire. If InvertTimeRange is , the time range is inverted: that is, all times outside the defined time range are excluded.

Note when using DailyCalendar, it behaves on the same principals as, for example, WeeklyCalendar defines a set of days that are excluded every week. Likewise, DailyCalendar defines a set of times that are excluded every day.

See Also

Reference