View Source Plausible.Stats.DateTimeRange (Plausible v0.0.1)

Defines a struct similar Date.Range, but with DateTime instead of Date.

The structs should be created with the new!/2 function.

Summary

Types

@type t() :: %Plausible.Stats.DateTimeRange{
  first: %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()
  },
  last: %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()
  }
}

Functions

Link to this function

new!(first, last, timezone)

View Source

Creates a DateTimeRange struct from the given %Date{} structs.

The first datetime will become the first date at 00:00:00, and the last datetime will become the last date at 23:59:59. Both dates will be turned into %DateTime{} structs in the given timezone.

Link to this function

to_date_range(datetime_range, timezone)

View Source
Link to this function

to_timezone(date_time_range, timezone)

View Source