View Source Flamel.Moment protocol (flamel v1.10.0)

The Flamel.Moment protocol is responsible for converting a structure to a DateTime, Date, or ISO8601 string (only if applicable).

Summary

Types

t()

All the types that implement this protocol.

Functions

Converts term to a Date

Converts term to a DateTime.

Converts term to an ISO8601 string.

Types

@type t() :: term()

All the types that implement this protocol.

Functions

@spec to_date(t()) :: Date.t() | nil

Converts term to a Date

@spec to_datetime(t()) :: DateTime.t() | nil

Converts term to a DateTime.

@spec to_iso8601(t()) :: String.t() | nil

Converts term to an ISO8601 string.