DayEx.Parse (day_ex v1.10.115)

Copy Markdown View Source

Custom format string parser for DayEx.

Parses date strings using format tokens (the reverse of DayEx.Format). Reuses DayEx.Format.tokenize/1 for tokenizing the format string, then walks the input string consuming characters that match each token.

Summary

Functions

Parse input according to format using the default (:en) locale.

Parse input according to format with the given locale.

Functions

parse(input, format)

Parse input according to format using the default (:en) locale.

Returns {:ok, %DayEx{}} on success, {:error, reason} on failure.

parse(input, format, locale)

Parse input according to format with the given locale.

Returns {:ok, %DayEx{}} on success, {:error, reason} on failure.