xdan-datetimepicker-rails 2.4.5 → 2.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d587117d8b3dd751445bda248d2c6b46ef45b30
|
4
|
+
data.tar.gz: 5d0962a757bb44cc70825ad49242f79d658459cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d36112cc732842885de3ab9666d609f8723996d3ac905135b3e1d14d0369823ff599b3bbeda91f297a1b6992fe3dbf20e4e2f2b5ddb4fec05e80546a0a946ce
|
7
|
+
data.tar.gz: 670f1d6f61b57633a4b9177803dd703e22f1c55a6faf4c5f86ee5dc6722119814d8d0142245b20fa2cf462806a4ba155875c3db8d68a0e9470ca09e60ad27462
|
@@ -1,10 +1,21 @@
|
|
1
1
|
/**
|
2
|
-
* @preserve jQuery DateTimePicker plugin v2.4.
|
2
|
+
* @preserve jQuery DateTimePicker plugin v2.4.6
|
3
3
|
* @homepage http://xdsoft.net/jqplugins/datetimepicker/
|
4
|
-
*
|
4
|
+
* @author Chupurnov Valeriy (<chupurnov@gmail.com>)
|
5
5
|
*/
|
6
|
-
/*global document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/
|
7
|
-
(function (
|
6
|
+
/*global DateFormatter, document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/
|
7
|
+
;(function (factory) {
|
8
|
+
if ( typeof define === 'function' && define.amd ) {
|
9
|
+
// AMD. Register as an anonymous module.
|
10
|
+
define(['jquery', 'jquery-mousewheel', 'date-functions'], factory);
|
11
|
+
} else if (typeof exports === 'object') {
|
12
|
+
// Node/CommonJS style for Browserify
|
13
|
+
module.exports = factory;
|
14
|
+
} else {
|
15
|
+
// Browser globals
|
16
|
+
factory(jQuery);
|
17
|
+
}
|
18
|
+
}(function ($) {
|
8
19
|
'use strict';
|
9
20
|
var default_options = {
|
10
21
|
i18n: {
|
@@ -12,151 +23,169 @@
|
|
12
23
|
months: [
|
13
24
|
"كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"
|
14
25
|
],
|
15
|
-
|
26
|
+
dayOfWeekShort: [
|
16
27
|
"ن", "ث", "ع", "خ", "ج", "س", "ح"
|
17
|
-
]
|
28
|
+
],
|
29
|
+
dayOfWeek: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت", "الأحد"]
|
18
30
|
},
|
19
31
|
ro: { // Romanian
|
20
32
|
months: [
|
21
|
-
"
|
33
|
+
"Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"
|
22
34
|
],
|
23
|
-
|
24
|
-
"
|
25
|
-
]
|
35
|
+
dayOfWeekShort: [
|
36
|
+
"Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ"
|
37
|
+
],
|
38
|
+
dayOfWeek: ["Duminică", "Luni", "Marţi", "Miercuri", "Joi", "Vineri", "Sâmbătă"]
|
26
39
|
},
|
27
40
|
id: { // Indonesian
|
28
41
|
months: [
|
29
42
|
"Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"
|
30
43
|
],
|
31
|
-
|
44
|
+
dayOfWeekShort: [
|
32
45
|
"Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"
|
33
|
-
]
|
46
|
+
],
|
47
|
+
dayOfWeek: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"]
|
34
48
|
},
|
35
49
|
is: { // Icelandic
|
36
50
|
months: [
|
37
51
|
"Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember"
|
38
52
|
],
|
39
|
-
|
53
|
+
dayOfWeekShort: [
|
40
54
|
"Sun", "Mán", "Þrið", "Mið", "Fim", "Fös", "Lau"
|
41
|
-
]
|
55
|
+
],
|
56
|
+
dayOfWeek: ["Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur"]
|
42
57
|
},
|
43
58
|
bg: { // Bulgarian
|
44
59
|
months: [
|
45
60
|
"Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"
|
46
61
|
],
|
47
|
-
|
62
|
+
dayOfWeekShort: [
|
48
63
|
"Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
|
49
|
-
]
|
64
|
+
],
|
65
|
+
dayOfWeek: ["Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота"]
|
50
66
|
},
|
51
67
|
fa: { // Persian/Farsi
|
52
68
|
months: [
|
53
69
|
'فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'
|
54
70
|
],
|
55
|
-
|
71
|
+
dayOfWeekShort: [
|
56
72
|
'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'
|
57
|
-
]
|
73
|
+
],
|
74
|
+
dayOfWeek: ["یکشنبه", "دوشنبه", "سهشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه", "یکشنبه"]
|
58
75
|
},
|
59
76
|
ru: { // Russian
|
60
77
|
months: [
|
61
78
|
'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'
|
62
79
|
],
|
63
|
-
|
64
|
-
"
|
65
|
-
]
|
80
|
+
dayOfWeekShort: [
|
81
|
+
"Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
|
82
|
+
],
|
83
|
+
dayOfWeek: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"]
|
66
84
|
},
|
67
85
|
uk: { // Ukrainian
|
68
86
|
months: [
|
69
87
|
'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'
|
70
88
|
],
|
71
|
-
|
89
|
+
dayOfWeekShort: [
|
72
90
|
"Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт"
|
73
|
-
]
|
91
|
+
],
|
92
|
+
dayOfWeek: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"]
|
74
93
|
},
|
75
94
|
en: { // English
|
76
95
|
months: [
|
77
96
|
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
|
78
97
|
],
|
79
|
-
|
98
|
+
dayOfWeekShort: [
|
80
99
|
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
|
81
|
-
]
|
100
|
+
],
|
101
|
+
dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
82
102
|
},
|
83
103
|
el: { // Ελληνικά
|
84
104
|
months: [
|
85
105
|
"Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"
|
86
106
|
],
|
87
|
-
|
107
|
+
dayOfWeekShort: [
|
88
108
|
"Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ"
|
89
|
-
]
|
109
|
+
],
|
110
|
+
dayOfWeek: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"]
|
90
111
|
},
|
91
112
|
de: { // German
|
92
113
|
months: [
|
93
114
|
'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
|
94
115
|
],
|
95
|
-
|
116
|
+
dayOfWeekShort: [
|
96
117
|
"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"
|
97
|
-
]
|
118
|
+
],
|
119
|
+
dayOfWeek: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"]
|
98
120
|
},
|
99
121
|
nl: { // Dutch
|
100
122
|
months: [
|
101
123
|
"januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"
|
102
124
|
],
|
103
|
-
|
125
|
+
dayOfWeekShort: [
|
104
126
|
"zo", "ma", "di", "wo", "do", "vr", "za"
|
105
|
-
]
|
127
|
+
],
|
128
|
+
dayOfWeek: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"]
|
106
129
|
},
|
107
130
|
tr: { // Turkish
|
108
131
|
months: [
|
109
132
|
"Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
|
110
133
|
],
|
111
|
-
|
134
|
+
dayOfWeekShort: [
|
112
135
|
"Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"
|
113
|
-
]
|
136
|
+
],
|
137
|
+
dayOfWeek: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"]
|
114
138
|
},
|
115
139
|
fr: { //French
|
116
140
|
months: [
|
117
141
|
"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
|
118
142
|
],
|
119
|
-
|
143
|
+
dayOfWeekShort: [
|
120
144
|
"Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"
|
121
|
-
]
|
145
|
+
],
|
146
|
+
dayOfWeek: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"]
|
122
147
|
},
|
123
148
|
es: { // Spanish
|
124
149
|
months: [
|
125
150
|
"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
|
126
151
|
],
|
127
|
-
|
152
|
+
dayOfWeekShort: [
|
128
153
|
"Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"
|
129
|
-
]
|
154
|
+
],
|
155
|
+
dayOfWeek: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"]
|
130
156
|
},
|
131
157
|
th: { // Thai
|
132
158
|
months: [
|
133
159
|
'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'
|
134
160
|
],
|
135
|
-
|
161
|
+
dayOfWeekShort: [
|
136
162
|
'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'
|
137
|
-
]
|
163
|
+
],
|
164
|
+
dayOfWeek: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุกร์", "เสาร์", "อาทิตย์"]
|
138
165
|
},
|
139
166
|
pl: { // Polish
|
140
167
|
months: [
|
141
168
|
"styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień"
|
142
169
|
],
|
143
|
-
|
170
|
+
dayOfWeekShort: [
|
144
171
|
"nd", "pn", "wt", "śr", "cz", "pt", "sb"
|
145
|
-
]
|
172
|
+
],
|
173
|
+
dayOfWeek: ["niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"]
|
146
174
|
},
|
147
175
|
pt: { // Portuguese
|
148
176
|
months: [
|
149
177
|
"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
|
150
178
|
],
|
151
|
-
|
179
|
+
dayOfWeekShort: [
|
152
180
|
"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"
|
153
|
-
]
|
181
|
+
],
|
182
|
+
dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"]
|
154
183
|
},
|
155
184
|
ch: { // Simplified Chinese
|
156
185
|
months: [
|
157
186
|
"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
|
158
187
|
],
|
159
|
-
|
188
|
+
dayOfWeekShort: [
|
160
189
|
"日", "一", "二", "三", "四", "五", "六"
|
161
190
|
]
|
162
191
|
},
|
@@ -164,7 +193,7 @@
|
|
164
193
|
months: [
|
165
194
|
"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
|
166
195
|
],
|
167
|
-
|
196
|
+
dayOfWeekShort: [
|
168
197
|
"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
|
169
198
|
]
|
170
199
|
},
|
@@ -172,63 +201,70 @@
|
|
172
201
|
months: [
|
173
202
|
"1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
|
174
203
|
],
|
175
|
-
|
204
|
+
dayOfWeekShort: [
|
176
205
|
"일", "월", "화", "수", "목", "금", "토"
|
177
|
-
]
|
206
|
+
],
|
207
|
+
dayOfWeek: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"]
|
178
208
|
},
|
179
209
|
it: { // Italian
|
180
210
|
months: [
|
181
211
|
"Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"
|
182
212
|
],
|
183
|
-
|
213
|
+
dayOfWeekShort: [
|
184
214
|
"Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"
|
185
|
-
]
|
215
|
+
],
|
216
|
+
dayOfWeek: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"]
|
186
217
|
},
|
187
218
|
da: { // Dansk
|
188
219
|
months: [
|
189
220
|
"January", "Februar", "Marts", "April", "Maj", "Juni", "July", "August", "September", "Oktober", "November", "December"
|
190
221
|
],
|
191
|
-
|
222
|
+
dayOfWeekShort: [
|
192
223
|
"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
|
193
|
-
]
|
224
|
+
],
|
225
|
+
dayOfWeek: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"]
|
194
226
|
},
|
195
227
|
no: { // Norwegian
|
196
228
|
months: [
|
197
229
|
"Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"
|
198
230
|
],
|
199
|
-
|
231
|
+
dayOfWeekShort: [
|
200
232
|
"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
|
201
|
-
]
|
233
|
+
],
|
234
|
+
dayOfWeek: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag']
|
202
235
|
},
|
203
236
|
ja: { // Japanese
|
204
237
|
months: [
|
205
238
|
"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"
|
206
239
|
],
|
207
|
-
|
240
|
+
dayOfWeekShort: [
|
208
241
|
"日", "月", "火", "水", "木", "金", "土"
|
209
|
-
]
|
242
|
+
],
|
243
|
+
dayOfWeek: ["日曜", "月曜", "火曜", "水曜", "木曜", "金曜", "土曜"]
|
210
244
|
},
|
211
245
|
vi: { // Vietnamese
|
212
246
|
months: [
|
213
247
|
"Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12"
|
214
248
|
],
|
215
|
-
|
249
|
+
dayOfWeekShort: [
|
216
250
|
"CN", "T2", "T3", "T4", "T5", "T6", "T7"
|
217
|
-
]
|
251
|
+
],
|
252
|
+
dayOfWeek: ["Chủ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy"]
|
218
253
|
},
|
219
254
|
sl: { // Slovenščina
|
220
255
|
months: [
|
221
256
|
"Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"
|
222
257
|
],
|
223
|
-
|
258
|
+
dayOfWeekShort: [
|
224
259
|
"Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"
|
225
|
-
]
|
260
|
+
],
|
261
|
+
dayOfWeek: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"]
|
226
262
|
},
|
227
263
|
cs: { // Čeština
|
228
264
|
months: [
|
229
265
|
"Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"
|
230
266
|
],
|
231
|
-
|
267
|
+
dayOfWeekShort: [
|
232
268
|
"Ne", "Po", "Út", "St", "Čt", "Pá", "So"
|
233
269
|
]
|
234
270
|
},
|
@@ -236,213 +272,252 @@
|
|
236
272
|
months: [
|
237
273
|
"Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"
|
238
274
|
],
|
239
|
-
|
275
|
+
dayOfWeekShort: [
|
240
276
|
"Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo"
|
241
|
-
]
|
277
|
+
],
|
278
|
+
dayOfWeek: ["vasárnap", "hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat"]
|
242
279
|
},
|
243
280
|
az: { //Azerbaijanian (Azeri)
|
244
281
|
months: [
|
245
282
|
"Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr"
|
246
283
|
],
|
247
|
-
|
284
|
+
dayOfWeekShort: [
|
248
285
|
"B", "Be", "Ça", "Ç", "Ca", "C", "Ş"
|
249
|
-
]
|
286
|
+
],
|
287
|
+
dayOfWeek: ["Bazar", "Bazar ertəsi", "Çərşənbə axşamı", "Çərşənbə", "Cümə axşamı", "Cümə", "Şənbə"]
|
250
288
|
},
|
251
289
|
bs: { //Bosanski
|
252
290
|
months: [
|
253
291
|
"Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
|
254
292
|
],
|
255
|
-
|
293
|
+
dayOfWeekShort: [
|
256
294
|
"Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
|
257
|
-
]
|
295
|
+
],
|
296
|
+
dayOfWeek: ["Nedjelja","Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"]
|
258
297
|
},
|
259
298
|
ca: { //Català
|
260
299
|
months: [
|
261
300
|
"Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"
|
262
301
|
],
|
263
|
-
|
302
|
+
dayOfWeekShort: [
|
264
303
|
"Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds"
|
265
|
-
]
|
304
|
+
],
|
305
|
+
dayOfWeek: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"]
|
266
306
|
},
|
267
307
|
'en-GB': { //English (British)
|
268
308
|
months: [
|
269
309
|
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
|
270
310
|
],
|
271
|
-
|
311
|
+
dayOfWeekShort: [
|
272
312
|
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
|
273
|
-
]
|
313
|
+
],
|
314
|
+
dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
274
315
|
},
|
275
316
|
et: { //"Eesti"
|
276
317
|
months: [
|
277
318
|
"Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"
|
278
319
|
],
|
279
|
-
|
320
|
+
dayOfWeekShort: [
|
280
321
|
"P", "E", "T", "K", "N", "R", "L"
|
281
|
-
]
|
322
|
+
],
|
323
|
+
dayOfWeek: ["Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev"]
|
282
324
|
},
|
283
325
|
eu: { //Euskara
|
284
326
|
months: [
|
285
327
|
"Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua"
|
286
328
|
],
|
287
|
-
|
329
|
+
dayOfWeekShort: [
|
288
330
|
"Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La."
|
289
|
-
]
|
331
|
+
],
|
332
|
+
dayOfWeek: ['Igandea', 'Astelehena', 'Asteartea', 'Asteazkena', 'Osteguna', 'Ostirala', 'Larunbata']
|
290
333
|
},
|
291
334
|
fi: { //Finnish (Suomi)
|
292
335
|
months: [
|
293
336
|
"Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"
|
294
337
|
],
|
295
|
-
|
338
|
+
dayOfWeekShort: [
|
296
339
|
"Su", "Ma", "Ti", "Ke", "To", "Pe", "La"
|
297
|
-
]
|
340
|
+
],
|
341
|
+
dayOfWeek: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"]
|
298
342
|
},
|
299
343
|
gl: { //Galego
|
300
344
|
months: [
|
301
345
|
"Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec"
|
302
346
|
],
|
303
|
-
|
347
|
+
dayOfWeekShort: [
|
304
348
|
"Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab"
|
305
|
-
]
|
349
|
+
],
|
350
|
+
dayOfWeek: ["Domingo", "Luns", "Martes", "Mércores", "Xoves", "Venres", "Sábado"]
|
306
351
|
},
|
307
352
|
hr: { //Hrvatski
|
308
353
|
months: [
|
309
354
|
"Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"
|
310
355
|
],
|
311
|
-
|
356
|
+
dayOfWeekShort: [
|
312
357
|
"Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
|
313
|
-
]
|
358
|
+
],
|
359
|
+
dayOfWeek: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"]
|
314
360
|
},
|
315
361
|
ko: { //Korean (한국어)
|
316
362
|
months: [
|
317
363
|
"1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
|
318
364
|
],
|
319
|
-
|
365
|
+
dayOfWeekShort: [
|
320
366
|
"일", "월", "화", "수", "목", "금", "토"
|
321
|
-
]
|
367
|
+
],
|
368
|
+
dayOfWeek: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"]
|
322
369
|
},
|
323
370
|
lt: { //Lithuanian (lietuvių)
|
324
371
|
months: [
|
325
372
|
"Sausio", "Vasario", "Kovo", "Balandžio", "Gegužės", "Birželio", "Liepos", "Rugpjūčio", "Rugsėjo", "Spalio", "Lapkričio", "Gruodžio"
|
326
373
|
],
|
327
|
-
|
374
|
+
dayOfWeekShort: [
|
328
375
|
"Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš"
|
329
|
-
]
|
376
|
+
],
|
377
|
+
dayOfWeek: ["Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis"]
|
330
378
|
},
|
331
379
|
lv: { //Latvian (Latviešu)
|
332
380
|
months: [
|
333
381
|
"Janvāris", "Februāris", "Marts", "Aprīlis ", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"
|
334
382
|
],
|
335
|
-
|
383
|
+
dayOfWeekShort: [
|
336
384
|
"Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St"
|
337
|
-
]
|
385
|
+
],
|
386
|
+
dayOfWeek: ["Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena"]
|
338
387
|
},
|
339
388
|
mk: { //Macedonian (Македонски)
|
340
389
|
months: [
|
341
390
|
"јануари", "февруари", "март", "април", "мај", "јуни", "јули", "август", "септември", "октомври", "ноември", "декември"
|
342
391
|
],
|
343
|
-
|
392
|
+
dayOfWeekShort: [
|
344
393
|
"нед", "пон", "вто", "сре", "чет", "пет", "саб"
|
345
|
-
]
|
394
|
+
],
|
395
|
+
dayOfWeek: ["Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота"]
|
346
396
|
},
|
347
397
|
mn: { //Mongolian (Монгол)
|
348
398
|
months: [
|
349
399
|
"1-р сар", "2-р сар", "3-р сар", "4-р сар", "5-р сар", "6-р сар", "7-р сар", "8-р сар", "9-р сар", "10-р сар", "11-р сар", "12-р сар"
|
350
400
|
],
|
351
|
-
|
401
|
+
dayOfWeekShort: [
|
352
402
|
"Дав", "Мяг", "Лха", "Пүр", "Бсн", "Бям", "Ням"
|
353
|
-
]
|
403
|
+
],
|
404
|
+
dayOfWeek: ["Даваа", "Мягмар", "Лхагва", "Пүрэв", "Баасан", "Бямба", "Ням"]
|
354
405
|
},
|
355
406
|
'pt-BR': { //Português(Brasil)
|
356
407
|
months: [
|
357
408
|
"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
|
358
409
|
],
|
359
|
-
|
410
|
+
dayOfWeekShort: [
|
360
411
|
"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"
|
361
|
-
]
|
412
|
+
],
|
413
|
+
dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"]
|
362
414
|
},
|
363
415
|
sk: { //Slovenčina
|
364
416
|
months: [
|
365
417
|
"Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"
|
366
418
|
],
|
367
|
-
|
419
|
+
dayOfWeekShort: [
|
368
420
|
"Ne", "Po", "Ut", "St", "Št", "Pi", "So"
|
369
|
-
]
|
421
|
+
],
|
422
|
+
dayOfWeek: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"]
|
370
423
|
},
|
371
424
|
sq: { //Albanian (Shqip)
|
372
425
|
months: [
|
373
|
-
"
|
426
|
+
"Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor"
|
374
427
|
],
|
375
|
-
|
376
|
-
"
|
377
|
-
]
|
428
|
+
dayOfWeekShort: [
|
429
|
+
"Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Shtu"
|
430
|
+
],
|
431
|
+
dayOfWeek: ["E Diel", "E Hënë", "E Martē", "E Mërkurë", "E Enjte", "E Premte", "E Shtunë"]
|
378
432
|
},
|
379
433
|
'sr-YU': { //Serbian (Srpski)
|
380
434
|
months: [
|
381
435
|
"Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
|
382
436
|
],
|
383
|
-
|
437
|
+
dayOfWeekShort: [
|
384
438
|
"Ned", "Pon", "Uto", "Sre", "čet", "Pet", "Sub"
|
385
|
-
]
|
439
|
+
],
|
440
|
+
dayOfWeek: ["Nedelja","Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota"]
|
386
441
|
},
|
387
442
|
sr: { //Serbian Cyrillic (Српски)
|
388
443
|
months: [
|
389
444
|
"јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар"
|
390
445
|
],
|
391
|
-
|
446
|
+
dayOfWeekShort: [
|
392
447
|
"нед", "пон", "уто", "сре", "чет", "пет", "суб"
|
393
|
-
]
|
448
|
+
],
|
449
|
+
dayOfWeek: ["Недеља","Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота"]
|
394
450
|
},
|
395
451
|
sv: { //Svenska
|
396
452
|
months: [
|
397
453
|
"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
|
398
454
|
],
|
399
|
-
|
455
|
+
dayOfWeekShort: [
|
400
456
|
"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
|
401
|
-
]
|
457
|
+
],
|
458
|
+
dayOfWeek: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"]
|
402
459
|
},
|
403
460
|
'zh-TW': { //Traditional Chinese (繁體中文)
|
404
461
|
months: [
|
405
462
|
"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
|
406
463
|
],
|
407
|
-
|
464
|
+
dayOfWeekShort: [
|
408
465
|
"日", "一", "二", "三", "四", "五", "六"
|
409
|
-
]
|
466
|
+
],
|
467
|
+
dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
|
410
468
|
},
|
411
469
|
zh: { //Simplified Chinese (简体中文)
|
412
470
|
months: [
|
413
471
|
"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
|
414
472
|
],
|
415
|
-
|
473
|
+
dayOfWeekShort: [
|
416
474
|
"日", "一", "二", "三", "四", "五", "六"
|
417
|
-
]
|
475
|
+
],
|
476
|
+
dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
|
418
477
|
},
|
419
478
|
he: { //Hebrew (עברית)
|
420
479
|
months: [
|
421
480
|
'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'
|
422
481
|
],
|
423
|
-
|
482
|
+
dayOfWeekShort: [
|
424
483
|
'א\'', 'ב\'', 'ג\'', 'ד\'', 'ה\'', 'ו\'', 'שבת'
|
425
|
-
]
|
484
|
+
],
|
485
|
+
dayOfWeek: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת", "ראשון"]
|
426
486
|
},
|
427
487
|
hy: { // Armenian
|
428
488
|
months: [
|
429
489
|
"Հունվար", "Փետրվար", "Մարտ", "Ապրիլ", "Մայիս", "Հունիս", "Հուլիս", "Օգոստոս", "Սեպտեմբեր", "Հոկտեմբեր", "Նոյեմբեր", "Դեկտեմբեր"
|
430
490
|
],
|
431
|
-
|
491
|
+
dayOfWeekShort: [
|
432
492
|
"Կի", "Երկ", "Երք", "Չոր", "Հնգ", "Ուրբ", "Շբթ"
|
493
|
+
],
|
494
|
+
dayOfWeek: ["Կիրակի", "Երկուշաբթի", "Երեքշաբթի", "Չորեքշաբթի", "Հինգշաբթի", "Ուրբաթ", "Շաբաթ"]
|
495
|
+
},
|
496
|
+
kg: { // Kyrgyz
|
497
|
+
months: [
|
498
|
+
'Үчтүн айы', 'Бирдин айы', 'Жалган Куран', 'Чын Куран', 'Бугу', 'Кулжа', 'Теке', 'Баш Оона', 'Аяк Оона', 'Тогуздун айы', 'Жетинин айы', 'Бештин айы'
|
499
|
+
],
|
500
|
+
dayOfWeekShort: [
|
501
|
+
"Жек", "Дүй", "Шей", "Шар", "Бей", "Жум", "Ише"
|
502
|
+
],
|
503
|
+
dayOfWeek: [
|
504
|
+
"Жекшемб", "Дүйшөмб", "Шейшемб", "Шаршемб", "Бейшемби", "Жума", "Ишенб"
|
505
|
+
]
|
506
|
+
},
|
507
|
+
rm: { // Romansh
|
508
|
+
months: [
|
509
|
+
"Schaner", "Favrer", "Mars", "Avrigl", "Matg", "Zercladur", "Fanadur", "Avust", "Settember", "October", "November", "December"
|
510
|
+
],
|
511
|
+
dayOfWeekShort: [
|
512
|
+
"Du", "Gli", "Ma", "Me", "Gie", "Ve", "So"
|
513
|
+
],
|
514
|
+
dayOfWeek: [
|
515
|
+
"Dumengia", "Glindesdi", "Mardi", "Mesemna", "Gievgia", "Venderdi", "Sonda"
|
433
516
|
]
|
434
517
|
},
|
435
|
-
kg: { // Kyrgyz
|
436
|
-
months: [
|
437
|
-
'Үчтүн айы', 'Бирдин айы', 'Жалган Куран', 'Чын Куран', 'Бугу', 'Кулжа', 'Теке', 'Баш Оона', 'Аяк Оона', 'Тогуздун айы', 'Жетинин айы', 'Бештин айы'
|
438
|
-
],
|
439
|
-
dayOfWeek: [
|
440
|
-
"Жек", "Дүй", "Шей", "Шар", "Бей", "Жум", "Ише"
|
441
|
-
]
|
442
|
-
}
|
443
518
|
},
|
444
519
|
value: '',
|
445
|
-
|
520
|
+
rtl: false,
|
446
521
|
|
447
522
|
format: 'Y/m/d H:i',
|
448
523
|
formatTime: 'H:i',
|
@@ -480,6 +555,7 @@
|
|
480
555
|
onSelectDate: function () {},
|
481
556
|
onSelectTime: function () {},
|
482
557
|
onChangeMonth: function () {},
|
558
|
+
onGetWeekOfYear: function () {},
|
483
559
|
onChangeYear: function () {},
|
484
560
|
onChangeDateTime: function () {},
|
485
561
|
onShow: function () {},
|
@@ -520,6 +596,8 @@
|
|
520
596
|
weekends: [],
|
521
597
|
highlightedDates: [],
|
522
598
|
highlightedPeriods: [],
|
599
|
+
allowDates : [],
|
600
|
+
allowDateRe : null,
|
523
601
|
disabledDates : [],
|
524
602
|
disabledWeekDays: [],
|
525
603
|
yearOffset: 0,
|
@@ -528,6 +606,53 @@
|
|
528
606
|
enterLikeTab: true,
|
529
607
|
showApplyButton: false
|
530
608
|
};
|
609
|
+
|
610
|
+
var dateHelper = null,
|
611
|
+
globalLocaleDefault = 'en',
|
612
|
+
globalLocale = 'en';
|
613
|
+
|
614
|
+
var dateFormatterOptionsDefault = {
|
615
|
+
meridiem: ['AM', 'PM']
|
616
|
+
};
|
617
|
+
|
618
|
+
var initDateFormatter = function(){
|
619
|
+
var locale = default_options.i18n[globalLocale],
|
620
|
+
opts = {
|
621
|
+
days: locale.dayOfWeek,
|
622
|
+
daysShort: locale.dayOfWeekShort,
|
623
|
+
months: locale.months,
|
624
|
+
monthsShort: $.map(locale.months, function(n){ return n.substring(0, 3) }),
|
625
|
+
};
|
626
|
+
|
627
|
+
dateHelper = new DateFormatter({
|
628
|
+
dateSettings: $.extend({}, dateFormatterOptionsDefault, opts)
|
629
|
+
});
|
630
|
+
};
|
631
|
+
|
632
|
+
// for locale settings
|
633
|
+
$.datetimepicker = {
|
634
|
+
setLocale: function(locale){
|
635
|
+
var newLocale = default_options.i18n[locale]?locale:globalLocaleDefault;
|
636
|
+
if(globalLocale != newLocale){
|
637
|
+
globalLocale = newLocale;
|
638
|
+
// reinit date formatter
|
639
|
+
initDateFormatter();
|
640
|
+
}
|
641
|
+
},
|
642
|
+
RFC_2822: 'D, d M Y H:i:s O',
|
643
|
+
ATOM: 'Y-m-d\TH:i:sP',
|
644
|
+
ISO_8601: 'Y-m-d\TH:i:sO',
|
645
|
+
RFC_822: 'D, d M y H:i:s O',
|
646
|
+
RFC_850: 'l, d-M-y H:i:s T',
|
647
|
+
RFC_1036: 'D, d M y H:i:s O',
|
648
|
+
RFC_1123: 'D, d M Y H:i:s O',
|
649
|
+
RSS: 'D, d M Y H:i:s O',
|
650
|
+
W3C: 'Y-m-d\TH:i:sP'
|
651
|
+
};
|
652
|
+
|
653
|
+
// first init date formatter
|
654
|
+
initDateFormatter();
|
655
|
+
|
531
656
|
// fix for ie8
|
532
657
|
if (!window.getComputedStyle) {
|
533
658
|
window.getComputedStyle = function (el, pseudo) {
|
@@ -623,12 +748,12 @@
|
|
623
748
|
startTopScroll = parseInt(scroller.css('margin-top'), 10);
|
624
749
|
h1 = scrollbar[0].offsetHeight;
|
625
750
|
|
626
|
-
if (event.type === 'mousedown') {
|
751
|
+
if (event.type === 'mousedown' || event.type === 'touchstart') {
|
627
752
|
if (document) {
|
628
753
|
$(document.body).addClass('xdsoft_noselect');
|
629
754
|
}
|
630
|
-
$([document.body, window]).on('mouseup.xdsoft_scroller', function arguments_callee() {
|
631
|
-
$([document.body, window]).off('mouseup.xdsoft_scroller', arguments_callee)
|
755
|
+
$([document.body, window]).on('touchend mouseup.xdsoft_scroller', function arguments_callee() {
|
756
|
+
$([document.body, window]).off('touchend mouseup.xdsoft_scroller', arguments_callee)
|
632
757
|
.off('mousemove.xdsoft_scroller', calcOffset)
|
633
758
|
.removeClass('xdsoft_noselect');
|
634
759
|
});
|
@@ -746,7 +871,7 @@
|
|
746
871
|
|
747
872
|
lazyInit = function (input) {
|
748
873
|
input
|
749
|
-
.on('open.xdsoft focusin.xdsoft mousedown.xdsoft', function initOnActionCallback(event) {
|
874
|
+
.on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function initOnActionCallback(event) {
|
750
875
|
if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) {
|
751
876
|
return;
|
752
877
|
}
|
@@ -757,7 +882,7 @@
|
|
757
882
|
createDateTimePicker(input);
|
758
883
|
}
|
759
884
|
input
|
760
|
-
.off('open.xdsoft focusin.xdsoft mousedown.xdsoft', initOnActionCallback)
|
885
|
+
.off('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', initOnActionCallback)
|
761
886
|
.trigger('open.xdsoft');
|
762
887
|
}, 100);
|
763
888
|
});
|
@@ -800,6 +925,9 @@
|
|
800
925
|
if (options.weeks) {
|
801
926
|
datetimepicker.addClass('xdsoft_showweeks');
|
802
927
|
}
|
928
|
+
if (options.rtl) {
|
929
|
+
datetimepicker.addClass('xdsoft_rtl');
|
930
|
+
}
|
803
931
|
|
804
932
|
datetimepicker.addClass('xdsoft_' + options.theme);
|
805
933
|
datetimepicker.addClass(options.className);
|
@@ -813,7 +941,7 @@
|
|
813
941
|
|
814
942
|
mounth_picker
|
815
943
|
.find('.xdsoft_month,.xdsoft_year')
|
816
|
-
.on('mousedown.xdsoft', function (event) {
|
944
|
+
.on('touchstart mousedown.xdsoft', function (event) {
|
817
945
|
var select = $(this).find('.xdsoft_select').eq(0),
|
818
946
|
val = 0,
|
819
947
|
top = 0,
|
@@ -845,12 +973,11 @@
|
|
845
973
|
mounth_picker
|
846
974
|
.find('.xdsoft_select')
|
847
975
|
.xdsoftScroller()
|
848
|
-
.on('mousedown.xdsoft', function (event) {
|
976
|
+
.on('touchstart mousedown.xdsoft', function (event) {
|
849
977
|
event.stopPropagation();
|
850
978
|
event.preventDefault();
|
851
979
|
})
|
852
|
-
.on('mousedown.xdsoft', '.xdsoft_option', function (event) {
|
853
|
-
|
980
|
+
.on('touchstart mousedown.xdsoft', '.xdsoft_option', function (event) {
|
854
981
|
if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
|
855
982
|
_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
|
856
983
|
}
|
@@ -925,12 +1052,20 @@
|
|
925
1052
|
options.weekends = $.extend(true, [], _options.weekends);
|
926
1053
|
}
|
927
1054
|
|
1055
|
+
if (_options.allowDates && $.isArray(_options.allowDates) && _options.allowDates.length) {
|
1056
|
+
options.allowDates = $.extend(true, [], _options.allowDates);
|
1057
|
+
}
|
1058
|
+
|
1059
|
+
if (_options.allowDateRe && Object.prototype.toString.call(_options.allowDateRe)==="[object String]") {
|
1060
|
+
options.allowDateRe = new RegExp(_options.allowDateRe);
|
1061
|
+
}
|
1062
|
+
|
928
1063
|
if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) {
|
929
1064
|
$.each(_options.highlightedDates, function (index, value) {
|
930
1065
|
var splitData = $.map(value.split(','), $.trim),
|
931
1066
|
exDesc,
|
932
|
-
hDate = new HighlightedDate(
|
933
|
-
keyDate = hDate.date
|
1067
|
+
hDate = new HighlightedDate(dateHelper.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]), // date, desc, style
|
1068
|
+
keyDate = dateHelper.formatDate(hDate.date, options.formatDate);
|
934
1069
|
if (highlightedDates[keyDate] !== undefined) {
|
935
1070
|
exDesc = highlightedDates[keyDate].desc;
|
936
1071
|
if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
|
@@ -947,18 +1082,30 @@
|
|
947
1082
|
if (_options.highlightedPeriods && $.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) {
|
948
1083
|
highlightedDates = $.extend(true, [], options.highlightedDates);
|
949
1084
|
$.each(_options.highlightedPeriods, function (index, value) {
|
950
|
-
var
|
951
|
-
|
952
|
-
|
953
|
-
desc = splitData[2],
|
1085
|
+
var dateTest, // start date
|
1086
|
+
dateEnd,
|
1087
|
+
desc,
|
954
1088
|
hDate,
|
955
1089
|
keyDate,
|
956
1090
|
exDesc,
|
1091
|
+
style;
|
1092
|
+
if ($.isArray(value)) {
|
1093
|
+
dateTest = value[0];
|
1094
|
+
dateEnd = value[1];
|
1095
|
+
desc = value[2];
|
1096
|
+
style = value[3];
|
1097
|
+
}
|
1098
|
+
else {
|
1099
|
+
var splitData = $.map(value.split(','), $.trim);
|
1100
|
+
dateTest = dateHelper.parseDate(splitData[0], options.formatDate);
|
1101
|
+
dateEnd = dateHelper.parseDate(splitData[1], options.formatDate);
|
1102
|
+
desc = splitData[2];
|
957
1103
|
style = splitData[3];
|
1104
|
+
}
|
958
1105
|
|
959
1106
|
while (dateTest <= dateEnd) {
|
960
1107
|
hDate = new HighlightedDate(dateTest, desc, style);
|
961
|
-
keyDate =
|
1108
|
+
keyDate = dateHelper.formatDate(dateTest, options.formatDate);
|
962
1109
|
dateTest.setDate(dateTest.getDate() + 1);
|
963
1110
|
if (highlightedDates[keyDate] !== undefined) {
|
964
1111
|
exDesc = highlightedDates[keyDate].desc;
|
@@ -1026,12 +1173,12 @@
|
|
1026
1173
|
timeboxparent.xdsoftScroller('hide');
|
1027
1174
|
}
|
1028
1175
|
|
1029
|
-
if (options.minDate &&
|
1030
|
-
options.minDate = _xdsoft_datetime.strToDateTime(options.minDate)
|
1176
|
+
if (options.minDate && /^[\+\-](.*)$/.test(options.minDate)) {
|
1177
|
+
options.minDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.minDate), options.formatDate);
|
1031
1178
|
}
|
1032
1179
|
|
1033
|
-
if (options.maxDate &&
|
1034
|
-
options.maxDate = _xdsoft_datetime.strToDateTime(options.maxDate)
|
1180
|
+
if (options.maxDate && /^[\+\-](.*)$/.test(options.maxDate)) {
|
1181
|
+
options.maxDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate), options.formatDate);
|
1035
1182
|
}
|
1036
1183
|
|
1037
1184
|
applyButton.toggle(options.showApplyButton);
|
@@ -1065,6 +1212,7 @@
|
|
1065
1212
|
if ($.type(options.mask) === 'string') {
|
1066
1213
|
if (!isValidValue(options.mask, input.val())) {
|
1067
1214
|
input.val(options.mask.replace(/[0-9]/g, '_'));
|
1215
|
+
setCaretPos(input[0], 0);
|
1068
1216
|
}
|
1069
1217
|
|
1070
1218
|
input.on('keydown.xdsoft', function (event) {
|
@@ -1127,7 +1275,7 @@
|
|
1127
1275
|
if (options.allowBlank && !$.trim($(this).val()).length) {
|
1128
1276
|
$(this).val(null);
|
1129
1277
|
datetimepicker.data('xdsoft_datetime').empty();
|
1130
|
-
} else if (!
|
1278
|
+
} else if (!dateHelper.parseDate($(this).val(), options.format)) {
|
1131
1279
|
var splittedHours = +([$(this).val()[0], $(this).val()[1]].join('')),
|
1132
1280
|
splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join(''));
|
1133
1281
|
|
@@ -1137,7 +1285,7 @@
|
|
1137
1285
|
return item > 9 ? item : '0' + item;
|
1138
1286
|
}).join(':'));
|
1139
1287
|
} else {
|
1140
|
-
$(this).val((_xdsoft_datetime.now()
|
1288
|
+
$(this).val(dateHelper.formatDate(_xdsoft_datetime.now(), options.format));
|
1141
1289
|
}
|
1142
1290
|
|
1143
1291
|
datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
|
@@ -1157,7 +1305,7 @@
|
|
1157
1305
|
|
1158
1306
|
datetimepicker
|
1159
1307
|
.data('options', options)
|
1160
|
-
.on('mousedown.xdsoft', function (event) {
|
1308
|
+
.on('touchstart mousedown.xdsoft', function (event) {
|
1161
1309
|
event.stopPropagation();
|
1162
1310
|
event.preventDefault();
|
1163
1311
|
yearselect.hide();
|
@@ -1297,7 +1445,16 @@
|
|
1297
1445
|
};
|
1298
1446
|
|
1299
1447
|
_this.getWeekOfYear = function (datetime) {
|
1448
|
+
if (options.onGetWeekOfYear && $.isFunction(options.onGetWeekOfYear)) {
|
1449
|
+
var week = options.onGetWeekOfYear.call(datetimepicker, datetime);
|
1450
|
+
if (typeof week !== 'undefined') {
|
1451
|
+
return week;
|
1452
|
+
}
|
1453
|
+
}
|
1300
1454
|
var onejan = new Date(datetime.getFullYear(), 0, 1);
|
1455
|
+
//First week of the year is th one with the first Thursday according to ISO8601
|
1456
|
+
if(onejan.getDay()!=4)
|
1457
|
+
onejan.setMonth(0, 1 + ((4 - onejan.getDay()+ 7) % 7));
|
1301
1458
|
return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7);
|
1302
1459
|
};
|
1303
1460
|
|
@@ -1310,13 +1467,13 @@
|
|
1310
1467
|
|
1311
1468
|
tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime);
|
1312
1469
|
if (tmpDate) {
|
1313
|
-
tmpDate[2] =
|
1470
|
+
tmpDate[2] = dateHelper.parseDate(tmpDate[2], options.formatDate);
|
1314
1471
|
}
|
1315
1472
|
if (tmpDate && tmpDate[2]) {
|
1316
1473
|
timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000;
|
1317
1474
|
currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset);
|
1318
1475
|
} else {
|
1319
|
-
currentTime = sDateTime ?
|
1476
|
+
currentTime = sDateTime ? dateHelper.parseDate(sDateTime, options.format) : _this.now();
|
1320
1477
|
}
|
1321
1478
|
|
1322
1479
|
if (!_this.isValidDate(currentTime)) {
|
@@ -1331,7 +1488,7 @@
|
|
1331
1488
|
return sDate;
|
1332
1489
|
}
|
1333
1490
|
|
1334
|
-
var currentTime = sDate ?
|
1491
|
+
var currentTime = sDate ? dateHelper.parseDate(sDate, options.formatDate) : _this.now(true);
|
1335
1492
|
if (!_this.isValidDate(currentTime)) {
|
1336
1493
|
currentTime = _this.now(true);
|
1337
1494
|
}
|
@@ -1342,7 +1499,7 @@
|
|
1342
1499
|
if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) {
|
1343
1500
|
return sTime;
|
1344
1501
|
}
|
1345
|
-
var currentTime = sTime ?
|
1502
|
+
var currentTime = sTime ? dateHelper.parseDate(sTime, options.formatTime) : _this.now(true);
|
1346
1503
|
if (!_this.isValidDate(currentTime)) {
|
1347
1504
|
currentTime = _this.now(true);
|
1348
1505
|
}
|
@@ -1350,14 +1507,14 @@
|
|
1350
1507
|
};
|
1351
1508
|
|
1352
1509
|
_this.str = function () {
|
1353
|
-
return _this.currentTime
|
1510
|
+
return dateHelper.formatDate(_this.currentTime, options.format);
|
1354
1511
|
};
|
1355
1512
|
_this.currentTime = this.now();
|
1356
1513
|
};
|
1357
1514
|
|
1358
1515
|
_xdsoft_datetime = new XDSoft_datetime();
|
1359
1516
|
|
1360
|
-
applyButton.on('click', function (e) {//pathbrite
|
1517
|
+
applyButton.on('touchend click', function (e) {//pathbrite
|
1361
1518
|
e.preventDefault();
|
1362
1519
|
datetimepicker.data('changed', true);
|
1363
1520
|
_xdsoft_datetime.setCurrentTime(getCurrentValue());
|
@@ -1366,7 +1523,7 @@
|
|
1366
1523
|
});
|
1367
1524
|
mounth_picker
|
1368
1525
|
.find('.xdsoft_today_button')
|
1369
|
-
.on('mousedown.xdsoft', function () {
|
1526
|
+
.on('touchend mousedown.xdsoft', function () {
|
1370
1527
|
datetimepicker.data('changed', true);
|
1371
1528
|
_xdsoft_datetime.setCurrentTime(0);
|
1372
1529
|
datetimepicker.trigger('afterOpen.xdsoft');
|
@@ -1384,11 +1541,12 @@
|
|
1384
1541
|
return;
|
1385
1542
|
}
|
1386
1543
|
input.val(_xdsoft_datetime.str());
|
1544
|
+
input.trigger('change');
|
1387
1545
|
datetimepicker.trigger('close.xdsoft');
|
1388
1546
|
});
|
1389
1547
|
mounth_picker
|
1390
1548
|
.find('.xdsoft_prev,.xdsoft_next')
|
1391
|
-
.on('mousedown.xdsoft', function () {
|
1549
|
+
.on('touchend mousedown.xdsoft', function () {
|
1392
1550
|
var $this = $(this),
|
1393
1551
|
timer = 0,
|
1394
1552
|
stop = false;
|
@@ -1406,16 +1564,16 @@
|
|
1406
1564
|
}
|
1407
1565
|
}(500));
|
1408
1566
|
|
1409
|
-
$([document.body, window]).on('mouseup.xdsoft', function arguments_callee2() {
|
1567
|
+
$([document.body, window]).on('touchend mouseup.xdsoft', function arguments_callee2() {
|
1410
1568
|
clearTimeout(timer);
|
1411
1569
|
stop = true;
|
1412
|
-
$([document.body, window]).off('mouseup.xdsoft', arguments_callee2);
|
1570
|
+
$([document.body, window]).off('touchend mouseup.xdsoft', arguments_callee2);
|
1413
1571
|
});
|
1414
1572
|
});
|
1415
1573
|
|
1416
1574
|
timepicker
|
1417
1575
|
.find('.xdsoft_prev,.xdsoft_next')
|
1418
|
-
.on('mousedown.xdsoft', function () {
|
1576
|
+
.on('touchend mousedown.xdsoft', function () {
|
1419
1577
|
var $this = $(this),
|
1420
1578
|
timer = 0,
|
1421
1579
|
stop = false,
|
@@ -1435,11 +1593,11 @@
|
|
1435
1593
|
timer = setTimeout(arguments_callee4, v || period);
|
1436
1594
|
}
|
1437
1595
|
}(500));
|
1438
|
-
$([document.body, window]).on('mouseup.xdsoft', function arguments_callee5() {
|
1596
|
+
$([document.body, window]).on('touchend mouseup.xdsoft', function arguments_callee5() {
|
1439
1597
|
clearTimeout(timer);
|
1440
1598
|
stop = true;
|
1441
1599
|
$([document.body, window])
|
1442
|
-
.off('mouseup.xdsoft', arguments_callee5);
|
1600
|
+
.off('touchend mouseup.xdsoft', arguments_callee5);
|
1443
1601
|
});
|
1444
1602
|
});
|
1445
1603
|
|
@@ -1486,7 +1644,7 @@
|
|
1486
1644
|
}
|
1487
1645
|
|
1488
1646
|
for (j = 0; j < 7; j += 1) {
|
1489
|
-
table += '<th>' + options.i18n[
|
1647
|
+
table += '<th>' + options.i18n[globalLocale].dayOfWeekShort[(j + options.dayOfWeekStart) % 7] + '</th>';
|
1490
1648
|
}
|
1491
1649
|
|
1492
1650
|
table += '</tr></thead>';
|
@@ -1521,9 +1679,17 @@
|
|
1521
1679
|
customDateSettings = null;
|
1522
1680
|
}
|
1523
1681
|
|
1524
|
-
if
|
1682
|
+
if(options.allowDateRe && Object.prototype.toString.call(options.allowDateRe) === "[object RegExp]"){
|
1683
|
+
if(!options.allowDateRe.test(start.dateFormat(options.formatDate))){
|
1684
|
+
classes.push('xdsoft_disabled');
|
1685
|
+
}
|
1686
|
+
} else if(options.allowDates && options.allowDates.length>0){
|
1687
|
+
if(options.allowDates.indexOf(start.dateFormat(options.formatDate)) === -1){
|
1688
|
+
classes.push('xdsoft_disabled');
|
1689
|
+
}
|
1690
|
+
} else if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
|
1525
1691
|
classes.push('xdsoft_disabled');
|
1526
|
-
} else if (options.disabledDates.indexOf(
|
1692
|
+
} else if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
|
1527
1693
|
classes.push('xdsoft_disabled');
|
1528
1694
|
} else if (options.disabledWeekDays.indexOf(day) !== -1) {
|
1529
1695
|
classes.push('xdsoft_disabled');
|
@@ -1537,20 +1703,20 @@
|
|
1537
1703
|
classes.push('xdsoft_other_month');
|
1538
1704
|
}
|
1539
1705
|
|
1540
|
-
if ((options.defaultSelect || datetimepicker.data('changed')) && _xdsoft_datetime.currentTime
|
1706
|
+
if ((options.defaultSelect || datetimepicker.data('changed')) && dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) {
|
1541
1707
|
classes.push('xdsoft_current');
|
1542
1708
|
}
|
1543
1709
|
|
1544
|
-
if (
|
1710
|
+
if (dateHelper.formatDate(today, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) {
|
1545
1711
|
classes.push('xdsoft_today');
|
1546
1712
|
}
|
1547
1713
|
|
1548
|
-
if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(
|
1714
|
+
if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
|
1549
1715
|
classes.push('xdsoft_weekend');
|
1550
1716
|
}
|
1551
1717
|
|
1552
|
-
if (options.highlightedDates[
|
1553
|
-
hDate = options.highlightedDates[
|
1718
|
+
if (options.highlightedDates[dateHelper.formatDate(start, options.formatDate)] !== undefined) {
|
1719
|
+
hDate = options.highlightedDates[dateHelper.formatDate(start, options.formatDate)];
|
1554
1720
|
classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style);
|
1555
1721
|
description = hDate.desc === undefined ? '' : hDate.desc;
|
1556
1722
|
}
|
@@ -1582,15 +1748,17 @@
|
|
1582
1748
|
|
1583
1749
|
calendar.html(table);
|
1584
1750
|
|
1585
|
-
mounth_picker.find('.xdsoft_label span').eq(0).text(options.i18n[
|
1751
|
+
mounth_picker.find('.xdsoft_label span').eq(0).text(options.i18n[globalLocale].months[_xdsoft_datetime.currentTime.getMonth()]);
|
1586
1752
|
mounth_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear());
|
1587
1753
|
|
1588
1754
|
// generate timebox
|
1589
1755
|
time = '';
|
1590
1756
|
h = '';
|
1591
1757
|
m = '';
|
1758
|
+
|
1592
1759
|
line_time = function line_time(h, m) {
|
1593
|
-
var now = _xdsoft_datetime.now(), optionDateTime, current_time
|
1760
|
+
var now = _xdsoft_datetime.now(), optionDateTime, current_time,
|
1761
|
+
isALlowTimesInit = options.allowTimes && $.isArray(options.allowTimes) && options.allowTimes.length;
|
1594
1762
|
now.setHours(h);
|
1595
1763
|
h = parseInt(now.getHours(), 10);
|
1596
1764
|
now.setMinutes(m);
|
@@ -1608,9 +1776,12 @@
|
|
1608
1776
|
|
1609
1777
|
current_time = new Date(_xdsoft_datetime.currentTime);
|
1610
1778
|
current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10));
|
1611
|
-
current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step);
|
1612
1779
|
|
1613
|
-
if (
|
1780
|
+
if (!isALlowTimesInit) {
|
1781
|
+
current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step);
|
1782
|
+
}
|
1783
|
+
|
1784
|
+
if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && ((!isALlowTimesInit && options.step > 59) || current_time.getMinutes() === parseInt(m, 10))) {
|
1614
1785
|
if (options.defaultSelect || datetimepicker.data('changed')) {
|
1615
1786
|
classes.push('xdsoft_current');
|
1616
1787
|
} else if (options.initTime) {
|
@@ -1620,7 +1791,7 @@
|
|
1620
1791
|
if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) {
|
1621
1792
|
classes.push('xdsoft_today');
|
1622
1793
|
}
|
1623
|
-
time += '<div class="xdsoft_time ' + classes.join(' ') + '" data-hour="' + h + '" data-minute="' + m + '">' +
|
1794
|
+
time += '<div class="xdsoft_time ' + classes.join(' ') + '" data-hour="' + h + '" data-minute="' + m + '">' + dateHelper.formatDate(now, options.formatTime) + '</div>';
|
1624
1795
|
};
|
1625
1796
|
|
1626
1797
|
if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) {
|
@@ -1651,7 +1822,7 @@
|
|
1651
1822
|
.html(opt);
|
1652
1823
|
|
1653
1824
|
for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10); i += 1) {
|
1654
|
-
opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getMonth() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + options.i18n[
|
1825
|
+
opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getMonth() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + options.i18n[globalLocale].months[i] + '</div>';
|
1655
1826
|
}
|
1656
1827
|
monthselect.children().eq(0).html(opt);
|
1657
1828
|
$(datetimepicker)
|
@@ -1683,7 +1854,7 @@
|
|
1683
1854
|
|
1684
1855
|
timerclick = 0;
|
1685
1856
|
calendar
|
1686
|
-
.on('click.xdsoft', 'td', function (xdevent) {
|
1857
|
+
.on('touchend click.xdsoft', 'td', function (xdevent) {
|
1687
1858
|
xdevent.stopPropagation(); // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap
|
1688
1859
|
timerclick += 1;
|
1689
1860
|
var $this = $(this),
|
@@ -1706,9 +1877,6 @@
|
|
1706
1877
|
datetimepicker.trigger('select.xdsoft', [currentTime]);
|
1707
1878
|
|
1708
1879
|
input.val(_xdsoft_datetime.str());
|
1709
|
-
if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === false && !options.timepicker))) && !options.inline) {
|
1710
|
-
datetimepicker.trigger('close.xdsoft');
|
1711
|
-
}
|
1712
1880
|
|
1713
1881
|
if (options.onSelectDate && $.isFunction(options.onSelectDate)) {
|
1714
1882
|
options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
|
@@ -1717,13 +1885,16 @@
|
|
1717
1885
|
datetimepicker.data('changed', true);
|
1718
1886
|
datetimepicker.trigger('xchange.xdsoft');
|
1719
1887
|
datetimepicker.trigger('changedatetime.xdsoft');
|
1888
|
+
if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === false && !options.timepicker))) && !options.inline) {
|
1889
|
+
datetimepicker.trigger('close.xdsoft');
|
1890
|
+
}
|
1720
1891
|
setTimeout(function () {
|
1721
1892
|
timerclick = 0;
|
1722
1893
|
}, 200);
|
1723
1894
|
});
|
1724
1895
|
|
1725
1896
|
timebox
|
1726
|
-
.on('click.xdsoft', 'div', function (xdevent) {
|
1897
|
+
.on('touchend click.xdsoft', 'div', function (xdevent) {
|
1727
1898
|
xdevent.stopPropagation();
|
1728
1899
|
var $this = $(this),
|
1729
1900
|
currentTime = _xdsoft_datetime.currentTime;
|
@@ -1742,16 +1913,15 @@
|
|
1742
1913
|
|
1743
1914
|
datetimepicker.data('input').val(_xdsoft_datetime.str());
|
1744
1915
|
|
1745
|
-
if (options.inline !== true && options.closeOnTimeSelect === true) {
|
1746
|
-
datetimepicker.trigger('close.xdsoft');
|
1747
|
-
}
|
1748
|
-
|
1749
1916
|
if (options.onSelectTime && $.isFunction(options.onSelectTime)) {
|
1750
1917
|
options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
|
1751
1918
|
}
|
1752
1919
|
datetimepicker.data('changed', true);
|
1753
1920
|
datetimepicker.trigger('xchange.xdsoft');
|
1754
1921
|
datetimepicker.trigger('changedatetime.xdsoft');
|
1922
|
+
if (options.inline !== true && options.closeOnTimeSelect === true) {
|
1923
|
+
datetimepicker.trigger('close.xdsoft');
|
1924
|
+
}
|
1755
1925
|
});
|
1756
1926
|
|
1757
1927
|
|
@@ -1818,20 +1988,41 @@
|
|
1818
1988
|
current_time_index = 0;
|
1819
1989
|
|
1820
1990
|
setPos = function () {
|
1821
|
-
|
1991
|
+
/**
|
1992
|
+
* 修复输入框在window最右边,且输入框的宽度小于日期控件宽度情况下,日期控件显示不全的bug。
|
1993
|
+
* Bug fixed - The datetimepicker will overflow-y when the width of the date input less than its, which
|
1994
|
+
* could causes part of the datetimepicker being hidden.
|
1995
|
+
* by Soon start
|
1996
|
+
*/
|
1997
|
+
var offset = datetimepicker.data('input').offset(),
|
1998
|
+
datetimepickerelement = datetimepicker.data('input')[0],
|
1999
|
+
top = offset.top + datetimepickerelement.offsetHeight - 1,
|
2000
|
+
left = offset.left,
|
2001
|
+
position = "absolute",
|
2002
|
+
node;
|
2003
|
+
|
2004
|
+
if ((document.documentElement.clientWidth - offset.left) < datepicker.parent().outerWidth(true)) {
|
2005
|
+
var diff = datepicker.parent().outerWidth(true) - datetimepickerelement.offsetWidth;
|
2006
|
+
left = left - diff;
|
2007
|
+
}
|
2008
|
+
/**
|
2009
|
+
* by Soon end
|
2010
|
+
*/
|
2011
|
+
if (datetimepicker.data('input').parent().css('direction') == 'rtl')
|
2012
|
+
left -= (datetimepicker.outerWidth() - datetimepicker.data('input').outerWidth());
|
1822
2013
|
if (options.fixed) {
|
1823
2014
|
top -= $(window).scrollTop();
|
1824
2015
|
left -= $(window).scrollLeft();
|
1825
2016
|
position = "fixed";
|
1826
2017
|
} else {
|
1827
|
-
if (top +
|
1828
|
-
top = offset.top -
|
2018
|
+
if (top + datetimepickerelement.offsetHeight > $(window).height() + $(window).scrollTop()) {
|
2019
|
+
top = offset.top - datetimepickerelement.offsetHeight + 1;
|
1829
2020
|
}
|
1830
2021
|
if (top < 0) {
|
1831
2022
|
top = 0;
|
1832
2023
|
}
|
1833
|
-
if (left +
|
1834
|
-
left = $(window).width() -
|
2024
|
+
if (left + datetimepickerelement.offsetWidth > $(window).width()) {
|
2025
|
+
left = $(window).width() - datetimepickerelement.offsetWidth;
|
1835
2026
|
}
|
1836
2027
|
}
|
1837
2028
|
|
@@ -1863,9 +2054,9 @@
|
|
1863
2054
|
.on('resize.xdsoft', setPos);
|
1864
2055
|
|
1865
2056
|
if (options.closeOnWithoutClick) {
|
1866
|
-
$([document.body, window]).on('mousedown.xdsoft', function arguments_callee6() {
|
2057
|
+
$([document.body, window]).on('touchstart mousedown.xdsoft', function arguments_callee6() {
|
1867
2058
|
datetimepicker.trigger('close.xdsoft');
|
1868
|
-
$([document.body, window]).off('mousedown.xdsoft', arguments_callee6);
|
2059
|
+
$([document.body, window]).off('touchstart mousedown.xdsoft', arguments_callee6);
|
1869
2060
|
});
|
1870
2061
|
}
|
1871
2062
|
}
|
@@ -1931,7 +2122,7 @@
|
|
1931
2122
|
|
1932
2123
|
input
|
1933
2124
|
.data('xdsoft_datetimepicker', datetimepicker)
|
1934
|
-
.on('open.xdsoft focusin.xdsoft mousedown.xdsoft', function (event) {
|
2125
|
+
.on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function (event) {
|
1935
2126
|
if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) {
|
1936
2127
|
return;
|
1937
2128
|
}
|
@@ -1951,7 +2142,7 @@
|
|
1951
2142
|
var val = this.value, elementSelector,
|
1952
2143
|
key = event.which;
|
1953
2144
|
if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) {
|
1954
|
-
elementSelector = $("input:visible,textarea:visible");
|
2145
|
+
elementSelector = $("input:visible,textarea:visible,button:visible,a:visible");
|
1955
2146
|
datetimepicker.trigger('close.xdsoft');
|
1956
2147
|
elementSelector.eq(elementSelector.index(this) + 1).focus();
|
1957
2148
|
return false;
|
@@ -1971,7 +2162,7 @@
|
|
1971
2162
|
.data('xdsoft_datetimepicker', null)
|
1972
2163
|
.off('.xdsoft');
|
1973
2164
|
$(window).off('resize.xdsoft');
|
1974
|
-
$([window, document.body]).off('mousedown.xdsoft');
|
2165
|
+
$([window, document.body]).off('mousedown.xdsoft touchstart');
|
1975
2166
|
if (input.unmousewheel) {
|
1976
2167
|
input.unmousewheel();
|
1977
2168
|
}
|
@@ -2009,7 +2200,7 @@
|
|
2009
2200
|
break;
|
2010
2201
|
case 'reset':
|
2011
2202
|
this.value = this.defaultValue;
|
2012
|
-
if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(
|
2203
|
+
if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(dateHelper.parseDate(this.value, options.format))) {
|
2013
2204
|
datetimepicker.data('changed', false);
|
2014
2205
|
}
|
2015
2206
|
datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value);
|
@@ -2035,39 +2226,12 @@
|
|
2035
2226
|
});
|
2036
2227
|
};
|
2037
2228
|
$.fn.datetimepicker.defaults = default_options;
|
2038
|
-
|
2039
|
-
|
2040
|
-
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
(function () {
|
2048
|
-
|
2049
|
-
/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
|
2050
|
-
* Licensed under the MIT License (LICENSE.txt).
|
2051
|
-
*
|
2052
|
-
* Version: 3.1.12
|
2053
|
-
*
|
2054
|
-
* Requires: jQuery 1.2.2+
|
2055
|
-
*/
|
2056
|
-
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
|
2057
|
-
|
2058
|
-
// Parse and Format Library
|
2059
|
-
//http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/
|
2060
|
-
/*
|
2061
|
-
* Copyright (C) 2004 Baron Schwartz <baron at sequent dot org>
|
2062
|
-
*
|
2063
|
-
* This program is free software; you can redistribute it and/or modify it
|
2064
|
-
* under the terms of the GNU Lesser General Public License as published by the
|
2065
|
-
* Free Software Foundation, version 2.1.
|
2066
|
-
*
|
2067
|
-
* This program is distributed in the hope that it will be useful, but WITHOUT
|
2068
|
-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
2069
|
-
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
2070
|
-
* details.
|
2071
|
-
*/
|
2072
|
-
Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(b){if(b=="unixtime"){return parseInt(this.getTime()/1000);}if(Date.formatFunctions[b]==null){Date.createNewFormat(b);}var a=Date.formatFunctions[b];return this[a]();};Date.createNewFormat=function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;var codePrefix="Date.prototype."+funcName+" = function() {return ";var code="";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true;}else{if(special){special=false;code+="'"+String.escape(ch)+"' + ";}else{code+=Date.getFormatCode(ch);}}}if(code.length==0){code="\"\"";}else{code=code.substring(0,code.length-3);}eval(codePrefix+code+";}");};Date.getFormatCode=function(a){switch(a){case"d":return"String.leftPad(this.getDate(), 2, '0') + ";case"D":return"Date.dayNames[this.getDay()].substring(0, 3) + ";case"j":return"this.getDate() + ";case"l":return"Date.dayNames[this.getDay()] + ";case"S":return"this.getSuffix() + ";case"w":return"this.getDay() + ";case"z":return"this.getDayOfYear() + ";case"W":return"this.getWeekOfYear() + ";case"F":return"Date.monthNames[this.getMonth()] + ";case"m":return"String.leftPad(this.getMonth() + 1, 2, '0') + ";case"M":return"Date.monthNames[this.getMonth()].substring(0, 3) + ";case"n":return"(this.getMonth() + 1) + ";case"t":return"this.getDaysInMonth() + ";case"L":return"(this.isLeapYear() ? 1 : 0) + ";case"Y":return"this.getFullYear() + ";case"y":return"('' + this.getFullYear()).substring(2, 4) + ";case"a":return"(this.getHours() < 12 ? 'am' : 'pm') + ";case"A":return"(this.getHours() < 12 ? 'AM' : 'PM') + ";case"g":return"((this.getHours() %12) ? this.getHours() % 12 : 12) + ";case"G":return"this.getHours() + ";case"h":return"String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";case"H":return"String.leftPad(this.getHours(), 2, '0') + ";case"i":return"String.leftPad(this.getMinutes(), 2, '0') + ";case"s":return"String.leftPad(this.getSeconds(), 2, '0') + ";case"O":return"this.getGMTOffset() + ";case"T":return"this.getTimezone() + ";case"Z":return"(this.getTimezoneOffset() * -60) + ";default:return"'"+String.escape(a)+"' + ";}};Date.parseDate=function(a,c){if(c=="unixtime"){return new Date(!isNaN(parseInt(a))?parseInt(a)*1000:0);}if(Date.parseFunctions[c]==null){Date.createParser(c);}var b=Date.parseFunctions[c];return Date[b](a);};Date.createParser=function(format){var funcName="parse"+Date.parseFunctions.count++;var regexNum=Date.parseRegexes.length;var currentGroup=1;Date.parseFunctions[format]=funcName;var code="Date."+funcName+" = function(input) {\nvar y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, z = -1;\nvar d = new Date();\ny = d.getFullYear();\nm = d.getMonth();\nd = d.getDate();\nvar results = input.match(Date.parseRegexes["+regexNum+"]);\nif (results && results.length > 0) {";var regex="";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true;}else{if(special){special=false;regex+=String.escape(ch);}else{obj=Date.formatCodeToRegex(ch,currentGroup);currentGroup+=obj.g;regex+=obj.s;if(obj.g&&obj.c){code+=obj.c;}}}}code+="if (y > 0 && z > 0){\nvar doyDate = new Date(y,0);\ndoyDate.setDate(z);\nm = doyDate.getMonth();\nd = doyDate.getDate();\n}";code+="if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n{return new Date(y, m, d, h, i, s);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n{return new Date(y, m, d, h, i);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0)\n{return new Date(y, m, d, h);}\nelse if (y > 0 && m >= 0 && d > 0)\n{return new Date(y, m, d);}\nelse if (y > 0 && m >= 0)\n{return new Date(y, m);}\nelse if (y > 0)\n{return new Date(y);}\n}return null;}";Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$",'i');eval(code);};Date.formatCodeToRegex=function(b,a){switch(b){case"D":return{g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":case"d":return{g:1,c:"d = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"l":return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case"S":return{g:0,c:null,s:"(?:st|nd|rd|th)"};case"w":return{g:0,c:null,s:"\\d"};case"z":return{g:1,c:"z = parseInt(results["+a+"], 10);\n",s:"(\\d{1,3})"};case"W":return{g:0,c:null,s:"(?:\\d{2})"};case"F":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case"n":case"m":return{g:1,c:"m = parseInt(results["+a+"], 10) - 1;\n",s:"(\\d{1,2})"};case"t":return{g:0,c:null,s:"\\d{1,2}"};case"L":return{g:0,c:null,s:"(?:1|0)"};case"Y":return{g:1,c:"y = parseInt(results["+a+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+a+"], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+a+"] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+a+"] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case"g":case"G":case"h":case"H":return{g:1,c:"h = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"i":return{g:1,c:"i = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"O":return{g:0,c:null,s:"[+-]\\d{4}"};case"T":return{g:0,c:null,s:"[A-Z]{3}"};case"Z":return{g:0,c:null,s:"[+-]\\d{1,5}"};default:return{g:0,c:null,s:String.escape(b)};}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{3}) [0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3");};Date.prototype.getGMTOffset=function(){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+String.leftPad(Math.abs(this.getTimezoneOffset())%60,2,"0");};Date.prototype.getDayOfYear=function(){var a=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var b=0;b<this.getMonth();++b){a+=Date.daysInMonth[b];}return a+this.getDate();};Date.prototype.getWeekOfYear=function(){var b=this.getDayOfYear()+(4-this.getDay());var a=new Date(this.getFullYear(),0,1);var c=(7-a.getDay()+4);return String.leftPad(Math.ceil((b-c)/7)+1,2,"0");};Date.prototype.isLeapYear=function(){var a=this.getFullYear();return((a&3)==0&&(a%100||(a%400==0&&a)));};Date.prototype.getFirstDayOfMonth=function(){var a=(this.getDay()-(this.getDate()-1))%7;return(a<0)?(a+7):a;};Date.prototype.getLastDayOfMonth=function(){var a=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return(a<0)?(a+7):a;};Date.prototype.getDaysInMonth=function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()];};Date.prototype.getSuffix=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}};String.escape=function(a){return a.replace(/('|\\)/g,"\\$1");};String.leftPad=function(d,b,c){var a=new String(d);if(c==null){c=" ";}while(a.length<b){a=c+a;}return a;};Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.y2kYear=50;Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11};Date.patterns={ISO8601LongPattern:"Y-m-d H:i:s",ISO8601ShortPattern:"Y-m-d",ShortDatePattern:"n/j/Y",LongDatePattern:"l, F d, Y",FullDateTimePattern:"l, F d, Y g:i:s A",MonthDayPattern:"F d",ShortTimePattern:"g:i A",LongTimePattern:"g:i:s A",SortableDateTimePattern:"Y-m-d\\TH:i:s",UniversalSortableDateTimePattern:"Y-m-d H:i:sO",YearMonthPattern:"F, Y"};
|
2073
|
-
}());
|
2229
|
+
|
2230
|
+
function HighlightedDate(date, desc, style) {
|
2231
|
+
"use strict";
|
2232
|
+
this.date = date;
|
2233
|
+
this.desc = desc;
|
2234
|
+
this.style = style;
|
2235
|
+
}
|
2236
|
+
|
2237
|
+
}));
|