exgrid v0.4.0 ExGrid.Date

Utility functions used by API client modules

Summary

Functions

Compare two dates returning one of the following values:

  • -1 — the first date comes before the second one
  • 0 — both arguments represent the same date when coalesced to the same timezone.
  • 1 — the first date comes after the second one

Parses a date string to a datetime struct. Uses YYYY-M-D format by default

Functions

compare_dates(first_date, second_date)

Compare two dates returning one of the following values:

  • -1 — the first date comes before the second one
  • 0 — both arguments represent the same date when coalesced to the same timezone.
  • 1 — the first date comes after the second one
compare_dates(first_date, second_date, format \\ "{YYYY}-{M}-{D}")
parse_date(date, format \\ "{YYYY}-{M}-{D}")

Parses a date string to a datetime struct. Uses YYYY-M-D format by default.