TimeRule class abstract

Used to indicate a time period of one or more intervals in GDF specification.

For example: -*(M3f21h2){M9}(M11f12h2){-M9}+(h15){h2}(h20){h2}, which represents: March 2nd Sunday 02h:00m for 9 months ONLY DURING November 1st Sunday 02h:00m from 9 months ago BUT NOT from 15:00 to 17:00 OR 20:00 to 22:00

The operator * represents reccuring occurrence, + represents a logical OR operation and - represents exclusion meaning, BUT NOT operations.

This example string represents a time period that meets the following criteria:

  • M3f21h2: M3 denotes third month of the year, i.e. March, f2 stands for the second Sunday of the month (as "f" might indicate "first", "second", "third", etc.), 1 stands for the day of the week (1...7, Day of week, Sunday = day 1), and h2 represents the hour of the day (02:00) in 24 hour format.
  • {M9}: This denotes "for 9 months", with "M9" standing for nine months. The brackets {} indicate a duration.
  • M11f12h2: M11 denotes 11th month of the year, i.e. November, f1 stands for the first Monday of the month, 2 stands for the day of the week (1...7, Day of week, Monday = day 2), and h2 represents the hour of the day (02:00) in 24 hour format.
  • {-M9}: This denotes "9 months ago from the current stated time", with "-M9" standing for nine months in the past.
  • (h15){h2}(h20){h2}: 15:00 to 17:00 OR 20:00 to 22:00 The brackets {} denotes duration, and the negative sign - represents a past duration.

Note: The time period is a logical AND (&&) combination of two components or points in time and it only applies if a point in time is in both components.

For more advanced examples of TimeRule see here.

Constructors

TimeRule(String timeRule, int timeZoneOffsetSeconds, String dstSpec)
Creates a new instance of this class.
factory

Properties

dstSpec → String
Day saving time specification, as a string in ISO 14825 format, for the location where the time rule applies. Gets the value of day saving time specification, as a string in ISO 14825 format, for the location where the time rule applies.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timeRuleString → String
The time rule as a string in ISO 14825 format. Gets the value of time rule as a string in ISO 14825 format.
no setter
timeZoneOffsetSeconds → int
The time zone offset in seconds for the location where the time rule applies. Gets the value of time zone offset in seconds for the location where the time rule applies.
no setter

Methods

appliesTo(DateTime dateTime) → bool
  • dateTime date and time that should be used for rule verification.
  • noSuchMethod(Invocation invocation) → dynamic
    Invoked when a nonexistent method or property is accessed.
    inherited
    toString() → String
    A string representation of this object.
    inherited

    Operators

    operator ==(Object other) → bool
    The equality operator.
    inherited