timex v3.6.2 Timex.Parse.DateTime.Tokenizer behaviour View Source

Defines the API for a custom tokenizer which can extend Timex's datetime parsing facilities.

Link to this section Summary

Link to this section Callbacks

Link to this callback

apply(arg1, token, value)

View Source
apply(DateTime.t(), token :: atom(), value :: term()) ::
  DateTime.t() | {:error, term()} | :unrecognized
Link to this callback

tokenize(format_string)

View Source
tokenize(format_string :: String.t()) ::
  {:ok, [Timex.Parse.DateTime.Tokenizers.Directive.t()]} | {:error, term()}