View Source ExTeal.Fields.Date (ExTeal v0.28.1)
The Date
field may be used to generate a calendar date select.
The date format for display on the index and detail views may be defined using the Select.with_options/2
function:
Date.make(:date)
|> Date.with_options(%{"format" => "YYYY/MM/DD"})
Summary
Functions
Callback implementation for ExTeal.Field.apply_options_for/4
.
Callback implementation for ExTeal.Field.default_sortable/0
.
Callback implementation for ExTeal.Field.filterable_as/0
.
Set the format that the date is rendered with on the detail and index components.
Callback implementation for ExTeal.Field.make/2
.
Set the format that flatpickr will render the date in on forms.
Callback implementation for ExTeal.Field.sanitize_as/0
.
Callback implementation for ExTeal.Field.value_for/3
.
Types
@type valid_format() :: :short | :med | :full | :huge
Functions
Callback implementation for ExTeal.Field.apply_options_for/4
.
Callback implementation for ExTeal.Field.default_sortable/0
.
Callback implementation for ExTeal.Field.filterable_as/0
.
@spec format(ExTeal.Field.t(), valid_format()) :: ExTeal.Field.t()
Set the format that the date is rendered with on the detail and index components.
Uses luxon's toLocaleString to display the date in a localized format:
Examples:
:short en_US -> 10/14/1983 fr -> 14/10/1983
:med en_US -> Oct 14, 1983 fr -> 14 oct. 1983
:full en_US -> October 14, 1983 fr -> 14 octobre 1983
:huge en_US -> Tuesday, October 14, 1983 fr -> vendredi 14 octobre 1983
Callback implementation for ExTeal.Field.make/2
.
Set the format that flatpickr will render the date in on forms.
Format should be a string of flatpickr tokens
Callback implementation for ExTeal.Field.sanitize_as/0
.
Callback implementation for ExTeal.Field.value_for/3
.