A clean, flexible, and fully customizable persian date picker.
User can navigate through months and years. The datepicker shows dates that come from other than the main month being displayed. These other dates are also selectable.
Everything is formatted using the persian date filter and thus is also localized.
All settings can be provided as attributes in the persian-datepicker
or globally configured through the datepickerConfig
.
-
ng-model
: The date object. -
datepicker-mode
(Defaults: 'day') : Current mode of the datepicker (day|month|year). Can be used to initialize datepicker to specific mode. -
min-date
(Default: null) : Defines the minimum available date. -
max-date
(Default: null) : Defines the maximum available date. -
date-disabled (date, mode)
(Default: null) : An optional expression to disable visible options based on passing date and current mode (day|month|year). -
show-weeks
(Defaults: true) : Whether to display week numbers. -
starting-day
(Defaults: 6) : Starting day of the week from 0-6 (0=Sunday, ..., 6=Saturday). -
init-date
: The initial date view when no model value is not specified. -
min-mode
(Defaults: 'day') : Set a lower limit for mode. -
max-mode
(Defaults: 'year') : Set an upper limit for mode. -
format-day
(Default: 'dd') : Format of day in month. -
format-month
(Default: 'MMMM') : Format of month in year. -
format-year
(Default: 'yyyy') : Format of year in year range. -
format-day-header
(Default: 'EEE') : Format of day in week header. -
format-day-title
(Default: 'MMMM yyyy') : Format of title when selecting day. -
format-month-title
(Default: 'yyyy') : Format of title when selecting month. -
year-range
(Default: 20) : Number of years displayed in year selection.
Options for datepicker can be passed as JSON using the datepicker-options
attribute.
Specific settings for the datepicker-popup-persian
, that can globally configured through the datepickerPopupConfig
, are:
-
datepicker-popup-persian
(Default: 'yyyy-MM-dd') : The format for displayed dates. -
show-button-bar
(Default: true) : Whether to display a button bar underneath the datepicker. -
current-text
(Default: 'Today') : The text to display for the current day button. -
clear-text
(Default: 'Clear') : The text to display for the clear button. -
close-text
(Default: 'Done') : The text to display for the close button. -
close-on-date-selection
(Default: true) : Whether to close calendar when a date is chosen. -
datepicker-append-to-body
(Default: false): Append the datepicker popup element tobody
, rather than inserting afterdatepicker-popup
. For global configuration, usedatepickerPopupConfig.appendToBody
.
Depending on datepicker's current mode, the date may reffer either to day, month or year. Accordingly, the term view reffers either to a month, year or year range.
Left
: Move focus to the previous date. Will move to the last date of the previous view, if the current date is the first date of a view.Right
: Move focus to the next date. Will move to the first date of the following view, if the current date is the last date of a view.Up
: Move focus to the same column of the previous row. Will wrap to the appropriate row in the previous view.Down
: Move focus to the same column of the following row. Will wrap to the appropriate row in the following view.PgUp
: Move focus to the same date of the previous view. If that date does not exist, focus is placed on the last date of the month.PgDn
: Move focus to the same date of the following view. If that date does not exist, focus is placed on the last date of the month.Home
: Move to the first date of the view.End
: Move to the last date of the view.Enter
/Space
: Select date.Ctrl
+Up
: Move to an upper mode.Ctrl
+Down
: Move to a lower mode.Esc
: Will close popup, and move focus to the input.