Calendar v1.0.0 Calendar.DateTime.Interval View Source

An Interval consists of a start and an end DateTime.

Link to this section Summary

Functions

Returns true when the interval contains the given datetime.

Link to this section Types

Link to this type

t() View Source
t() :: %Calendar.DateTime.Interval{
  from: %DateTime{
    calendar: term(),
    day: term(),
    hour: term(),
    microsecond: term(),
    minute: term(),
    month: term(),
    second: term(),
    std_offset: term(),
    time_zone: term(),
    utc_offset: term(),
    year: term(),
    zone_abbr: term()
  },
  to: %DateTime{
    calendar: term(),
    day: term(),
    hour: term(),
    microsecond: term(),
    minute: term(),
    month: term(),
    second: term(),
    std_offset: term(),
    time_zone: term(),
    utc_offset: term(),
    year: term(),
    zone_abbr: term()
  }
}

Link to this section Functions

Link to this function

includes?(interval, datetime) View Source
includes?(t(), %DateTime{
  calendar: term(),
  day: term(),
  hour: term(),
  microsecond: term(),
  minute: term(),
  month: term(),
  second: term(),
  std_offset: term(),
  time_zone: term(),
  utc_offset: term(),
  year: term(),
  zone_abbr: term()
}) :: boolean()

Returns true when the interval contains the given datetime.

"From" and "to" datetimes are treated as inclusive. This means that if the provided datetime is between the from and to of the interval or equal to either, true will be returned.