You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**placement** | top, right, [bottom], left | Position of date time picker
45
+
**trigger** | [click], mouse down, focus, ... | Event to show date time picker
46
+
**enableTimePicker** | [false], true | Time picker visibility
47
+
**targetTextSelector** | String | CSS selector to show selected date as `format` property into it | '#TextBoxId'
48
+
**targetDateSelector** | String | CSS selector to save selected date into it | '#InputHiddenId'
49
+
**toDate** | [false], true | When you want to set date picker as `toDate` to enable date range selecting
50
+
**fromDate** | [false], true | When you want to set date picker as `fromDate` to enable date range selecting
51
+
**groupId** | String | When you want to use `toDate`, `fromDate` you have to enter a group id to specify date time pickers| 'dateRangeSelector1'
52
+
**disabled** | [false], true | Disable date time picker
53
+
**textFormat** | String | format of selected date to show into `targetTextSelector` | 'yyyy/MM/dd HH:mm:ss'
54
+
**dateFormat** | String | format of selected date to save into `targetDateSelector` | 'yyyy/MM/dd HH:mm:ss'
55
+
**isGregorian** | [false], true | Is calendar Gregorian
56
+
**inLine** | [false], true | Is date time picker in line
57
+
**modalMode** | [false], true | Open in modal mode, suitable for smart phones
58
+
**selectedDate** | [undefined], Date | Selected date as JavaScript Date object | new Date('2018/9/30')
59
+
**selectedDateToShow** | [new Date()], Date | Selected date to start calendar from it as JavaScript Date object | new Date('2018/9/30')
60
+
**selectedRangeDate** | Array: Date[] | Selected range date as JavaScript Date object | [new Date('2020/8/5'), new Date('2020/8/15')]
61
+
**yearOffset** | Number | Number of years to select in year selector | 30
62
+
**holiDays** | Array: Date[] | Array of holidays to show in date time picker as holiday | [new Date(), new Date(2017, 3, 2)]
63
+
**disabledDates** | Array: Date[] | Array of disabled dates to prevent user to select them | [new Date(2017, 1, 1), new Date(2017, 1, 2)]
64
+
**specialDates** | Array: Date[] | Array of dates to mark some dates as special | [new Date(2017, 2, 1), new Date(2017, 3, 2)]
65
+
**disabledDays** | Array: number[] | Array of disabled week days to prevent user to select them | Disable all "Thursday", "Friday" in persian [ 5, 6 ]
66
+
**disableBeforeToday** | [false], true | Disable days before today
67
+
**disableAfterToday** | [false], true | Disable days after today
68
+
**disableBeforeDate** | Date | Disable days before this Date | new Date(2018, 11, 12)
69
+
**disableAfterDate** | Date | Disable days after this Date | new Date(2018, 12, 11)
70
+
**rangeSelector** | [false], true | Enables rangeSelector feature on date time picker
71
+
**monthsToShow** | Numeric array with 2 items, [0 ,0] | To show, number of month before and after selected date in date time picker, first item is for before month, second item is for after month | [1, 1]
72
+
**calendarViewOnChange(date)** | function | Event fires on date picker's view change
73
+
**onDayClick(event)** | function | Event fires on day cell click
74
+
75
+
<hr>
76
+
77
+
### String format:
78
+
79
+
Format | English Description | Persian Description
80
+
------------- | ------------- | -------------
81
+
**yyyy** | Year, 4 digits | سال چهار رقمی
82
+
**yy** | Year, 2 digits | سال دو رقمی
83
+
**MMMM** | Month name | نام ماه
84
+
**MM** | Month, 2 digits | عدد دو رقمی ماه
85
+
**M** | Month, 1 digit | عدد تک رقمی ماه
86
+
**dddd** | Week day name | نام روز هفته
87
+
**dd** | Month's day, 2 digits | عدد دو رقمی روز
88
+
**d** | Month's day, 1 digit | عدد تک رقمی روز
89
+
**HH** | Hour, 2 digits - 0 - 24 | عدد دو رقمی ساعت با فرمت 0 تا 24
90
+
**H** | Hour, 1 digit - 0 - 24 | عدد تک رقمی ساعت با فرمت 0 تا 24
91
+
**hh** | Hour, 2 digits - 0 - 12 | عدد دو رقمی ساعت با فرمت 0 تا 12
92
+
**h** | Hour, 1 digit - 0 - 12 | عدد تک رقمی ساعت با فرمت 0 تا 12
**updateOption** | void | update one option of date picker | dtp1Instance.updateOption('isGregorian', false)
117
+
**updateOptions** | void | update one option of date picker | dtp1Instance.updateOptions({ isGregorian: false, inLine: false, ... })
118
+
**getInstance** | MdsPersianDateTimePicker | static method, get instance of MdsDatePicker by element | const jalaliObj = mds.MdsPersianDateTimePicker.dtp1Instance.getInstance(document.getELementById('IdOElement'));
119
+
**getText** | string | Get selected date text | const txt = dtp1Instance.getText()
120
+
**getDate** | Date | Get selected date | const dateObj = dtp1Instance.getDate()
121
+
**getDateRange** | [fromDate, toDate]: Date[] | Get selected date range | dtp1Instance.getDateRange();
122
+
**setDate** | void | Set selected datetime with Date object argument | dtp1Instance.setDate(new Date('2021/09/22'));
123
+
**setDatePersian** | void | Set selected datetime with Date object argument | dtp1Instance.setDatePersian(1400, 06, 31);
124
+
**setDateRange** | void | Set selected datetime range with Date object argument | dtp1Instance.setDateRange(new Date('2021/09/04'), new Date('2021/09/22'));
125
+
**clearDate** | void | clear selected date | dtp1Instance.clearDate();
126
+
**convertDateToString** | string | utility method, convert date object to string | const dateStr = dtp1Instance.convertDateToString(date: new Date(), isGregorian: false, format: 'yyyy/MM/dd');
127
+
**convertDateToJalali** | MdsPersianDateTimePickerConvertedDateModel | utility method, convert date object to Jalali | const jalaliObj = dtp1Instance.convertDateToJalali(new Date());
128
+
129
+
<hr>
130
+
131
+
### Events:
132
+
133
+
`MD.BootstrapPersianDateTimePicker` uses Bootstrap's popover, and Bootstrap's modals. so you can use `popover` or `modal` events.
0 commit comments