Cldr.DateTime.Compiler.tokenize
You're seeing just the function
tokenize
, go back to Cldr.DateTime.Compiler module for more information.
Scan a number format definition and return the tokens of a date/time/datetime format string.
This function is designed to produce output
that is fed into Cldr.DateTime.Compiler.compile/3
.
Arguments
definition
is a date, datetime or time format string
Returns
A list of 3-tuples which represent the tokens of the format definition
Example
iex> Cldr.DateTime.Compiler.tokenize "yyyy/MM/dd"
{:ok,
[{:year, 1, 4}, {:literal, 1, "/"}, {:month, 1, 2}, {:literal, 1, "/"},
{:day_of_month, 1, 2}], 1}