View Source Magical.Parser.DateParser (Magical v0.1.0)

Responsible for parsing datestrings in predefined formats with parse/1.

Summary

Functions

Responsible for parsing datestrings in predefined formats into %DateTime{} structs. Valid formats are defined by the "Internet Calendaring and Scheduling Core Object Specification" (RFC 2445).

Functions

@spec parse(String.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()
  }
  | %NaiveDateTime{
      calendar: term(),
      day: term(),
      hour: term(),
      microsecond: term(),
      minute: term(),
      month: term(),
      second: term(),
      year: term()
    }
  | %Date{calendar: term(), day: term(), month: term(), year: term()}
  | nil

Responsible for parsing datestrings in predefined formats into %DateTime{} structs. Valid formats are defined by the "Internet Calendaring and Scheduling Core Object Specification" (RFC 2445).