Cldr Calendars Format v0.4.0 Cldr.Calendar.Formatter.Options View Source
Defines and validates the options for a calendar formatter.
These options are passed to the formatter
callbacks defined in Cldr.Calendar.Formatter
.
The valid options are:
:calendar
is an calendar module defined withuse Cldr.Calendar
.:backend
is any module that applieduse Cldr
. The default isCldr.default_backend()
.:formatter
is any module implementing theCldr.Calendar.Formatter
behaviour.:locale
is any locale returned byCldr.validate_locale/1
. The default isCldr.get_locale()
.:number_system
is any valid number system name or number system type for the given locale. Available number systems for a locale are returned byCldr.Number.System.number_systems_for(locale, backend)
. The default is:default
.:territory
is any territory returned byCldr.validate_territory/1
The default isCldr.Locale.territory_from_locale/1
.:caption
is a caption to be applied in any way defined by the:formatter
. The default isnil
.:class
is a class name that can be used any way defined by the:formatter
. It is most commonly used to apply an HTML class to an enclosing tag. The default isCldr.Calendar.Format.default_calendar_css_class/0
:id
is an id that can be used any way defined by the:formatter
. It is most commonly used to apply an HTML id to an enclosing tag. The default isnil
:private
is for your private use in your formatter. For example if you wanted to pass a selected day and format it differently, you could provideoptions.private = %{selected: ~D[2020-04-05]}
and take advantage of it while formatting the days.:today
is anyDate.t
that represents today. It is commonly used to allow a formatting to appropriately format a date that is today differently to other days on a calendar. The default isDate.utc_today/0
:day_names
is a list of 2-tuples that map the day of the week to a localised day name that are most often used as headers for a month. The default is automatically calculated from the provided:calendar
and:locale
.
Link to this section Summary
Link to this section Types
t()
View Sourcet() :: %Cldr.Calendar.Formatter.Options{ backend: module(), calendar: module(), caption: String.t() | nil, class: String.t() | nil, day_names: [{1..7, String.t()}], formatter: module(), id: String.t() | nil, locale: Cldr.LanguageTag.t(), number_system: Cldr.Number.System.system_name(), private: any(), territory: atom() | String.t(), today: Date.t() }
Formatter options