Timex.Parsers.DateFormat.Directive

This module defines parsing directives for all date/time tokens timex knows about. It is composed of a Directive struct, containing the rules for parsing a given token, and a get/1 function, which fetches a directive for a given token value, i.e. :year4.

Summary

get(token)

Gets a parsing directive for the given token name, where the token name is an atom

Functions

get(token)

Specs:

  • get(atom) :: %Timex.Parsers.DateFormat.Directive{format: term, len: term, match: term, max: term, min: term, optional: term, pad: term, pad_type: term, raw: term, token: term, type: term, validate: term}

Gets a parsing directive for the given token name, where the token name is an atom.

Example

iex> alias Timex.Parsers.Directive iex> Directive.get(:year4) %Directive{token: :year4, len: 1..4, type: :numeric, pad: 0}