Cldr.Calendar.Format (Cldr Calendars Format v1.0.0)

View Source

Formatting functions for calendars

Summary

Functions

default_calendar_css_class()

default_formatter_module()

formatter_module?(formatter)

invalid_date_error(date)

invalid_formatter_error(formatter)

month(year, month, options \\ [])

Format one calendar year and month

Arguments

  • year is the year of the calendar to be formatted

  • month is the month of the calendar to be formatted

  • options is a Cldr.Calendar.Formatter.Options struct or a Keyword.t list of options.

Returns

  • The result of the format_month/4 callback of the configured formatter

Examples

=> Cldr.Calendar.Format.month(2019, 4)

=> Cldr.Calendar.Format.month(2019, 4, formatter: Cldr.Calendar.Formatter.HTML.Basic)

=> Cldr.Calendar.Format.month(2019, 4, formatter: Cldr.Calendar.Formatter.Markdown, locale: "fr"

year(year, options \\ [])

Format one calendar year

Arguments

Returns

  • The result of the format_year/3 callback of the configured formatter

Examples

=> Cldr.Calendar.Format.year(2019)

=> Cldr.Calendar.Format.year(2019, formatter: Cldr.Calendar.Formatter.Markdown)

=> Cldr.Calendar.Format.year(2019, formatter: Cldr.Calendar.Formatter.Markdown, locale: "fr"