A pure js persian datepicker, powered by TypeScript :)
you have to installed NodeJS v8 up and recommended install Yarn.
- git clone https://github.com/mammad2c/mmd-persian-datepicker
- yarn or npm i
- yarn start or npm start
- open `example/index.html` at your browser
planing to migrate from moment to jalaali-js
- writing tests.
- modular codes.
- migrate to
jalaali-js
and drop usage ofmoment
.
-
defaultValue
: initial value, should be today by default on initial render. -
numberOfMonths
: how many months should be rendered. -
mode
:single
orrange
. -
disabledDates
: disable only some dates. -
enabledDates
: disable whole picker's dates except these dates. -
inline
: render picker like a normal calendar. -
maxDate
: maximum date user can select. -
minDate
: minimum date user can select. -
highlightWeekends
: show weekends with a different color. -
monthChanger
: enable selecting from months, also by setfalse
could disable it. -
yearChanger
: enable selecting from years, also by setfalse
could disable it. -
altInput
: alt input for actual sending data to server. -
altFormat
: date formats foraltInput
. -
readonly
: input could not editable directly. only changes by picker. -
clearButton
: render a button to clear selected date(s), useful whenmultiple
istrue
. -
todayButton
: go to today on picker. -
firstDayOfWeek
: weeks start days. for example on jalali issaturday
and on georgian ismonday
. should be configurable.
-
onBeforeOpen
: the event fires before datepicker open. -
onBeforeClose
: the event fires before datepicker close. -
onAfterMonthChange
: the event fires after changing the month. -
onAfterYearChange
: the event fires after changing the year. -
onDayCreate
: handle rendering date creates. adding custom element to day items and ... .
-
destroy
: destroy instance, remove addEventListeners and ... for nothing exists about the picker. this feature enable using this library in SPA frameworks such asreact
,vue
and ... . -
jumpToDate
: move picker to specific date. -
setDate
: set picker selected date(s) programmatically. -
toggle
: toggle betweenopen
andclose
of picker.