DarkMatter v1.0.3 DarkMatter.Dates View Source

Datetime Utils

Link to this section Summary

Functions

Transform a Date into a string.

Transform a stringable/0 into a string.

Link to this section Types

Specs

stringable() :: nil | String.t() | Date.t()

Link to this section Functions

Specs

cast_date(stringable()) :: nil | Date.t()

Casts a stringable/0 into a Date

Raises ArgumentError if a given Date isn't valid.

Specs

from_iso8601!(String.t()) :: Date.t()

Transform a Date into a string.

Raises ArgumentError if a given Date isn't valid.

Specs

to_string(stringable()) :: nil | String.t()

Transform a stringable/0 into a string.

Raises ArgumentError if a given binary isn't a valid Date.