jquery-dateandtimepicker-rails 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ed539537d9b38cae99731e9da25a8d3181e97186
4
+ data.tar.gz: af6dfc00dbb8d35f4961e4944752f8bf2af3fc51
5
+ SHA512:
6
+ metadata.gz: f2544beefe7b880984cf31b13cbd4bbe3d7d39292ca5169897bf62cc6871c4d5ffade022198b55f47f98ee453ee06bbb9b26715224e20b446fac969ec2cabf65
7
+ data.tar.gz: c43a086568505a2c1274b4f1aaf0c424fc2eacbb812bdffef72c4eea321113bdf17dc1feb051e44e870843dcbf06d1bda3cf35dcd36c0a15861e60e59a3a6c95
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ *.gem
2
+ /.bundle/
3
+ /.yardoc
4
+ /Gemfile.lock
5
+ /_yardoc/
6
+ /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in jquery-dateandtimepicker-rails.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Jquery::Dateandtimepicker::Rails
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/jquery/dateandtimepicker/rails`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'jquery-dateandtimepicker-rails'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install jquery-dateandtimepicker-rails
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jquery-dateandtimepicker-rails.
36
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'jquery/dateandtimepicker/rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'jquery-dateandtimepicker-rails'
8
+ spec.version = Jquery::Dateandtimepicker::Rails::VERSION
9
+ spec.authors = ['ksarunas']
10
+ spec.email = ['sarjalis@gmail.com']
11
+ spec.description = %q{A date and time picker for jQuery and Rails}
12
+ spec.summary = %q{This gem packages the datetimepicker jQuery plugin for Rails 3.1+ asset pipeline}
13
+ spec.homepage = 'https://github.com/ksarunas/jquery-dateandtimepicker-rails'
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_development_dependency 'bundler', '~> 1.10'
21
+ spec.add_development_dependency 'rake', '~> 10.0'
22
+ end
@@ -0,0 +1,2079 @@
1
+ /**
2
+ * @preserve jQuery DateTimePicker plugin v2.4.5
3
+ * @homepage http://xdsoft.net/jqplugins/datetimepicker/
4
+ * (c) 2014, Chupurnov Valeriy.
5
+ */
6
+ /*global document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/
7
+ (function ($) {
8
+ 'use strict';
9
+ var default_options = {
10
+ i18n: {
11
+ ar: { // Arabic
12
+ months: [
13
+ "كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"
14
+ ],
15
+ dayOfWeek: [
16
+ "ن", "ث", "ع", "خ", "ج", "س", "ح"
17
+ ]
18
+ },
19
+ ro: { // Romanian
20
+ months: [
21
+ "ianuarie", "februarie", "martie", "aprilie", "mai", "iunie", "iulie", "august", "septembrie", "octombrie", "noiembrie", "decembrie"
22
+ ],
23
+ dayOfWeek: [
24
+ "l", "ma", "mi", "j", "v", "s", "d"
25
+ ]
26
+ },
27
+ id: { // Indonesian
28
+ months: [
29
+ "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"
30
+ ],
31
+ dayOfWeek: [
32
+ "Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"
33
+ ]
34
+ },
35
+ is: { // Icelandic
36
+ months: [
37
+ "Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember"
38
+ ],
39
+ dayOfWeek: [
40
+ "Sun", "Mán", "Þrið", "Mið", "Fim", "Fös", "Lau"
41
+ ]
42
+ },
43
+ bg: { // Bulgarian
44
+ months: [
45
+ "Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"
46
+ ],
47
+ dayOfWeek: [
48
+ "Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
49
+ ]
50
+ },
51
+ fa: { // Persian/Farsi
52
+ months: [
53
+ 'فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'
54
+ ],
55
+ dayOfWeek: [
56
+ 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'
57
+ ]
58
+ },
59
+ ru: { // Russian
60
+ months: [
61
+ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'
62
+ ],
63
+ dayOfWeek: [
64
+ "Вск", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
65
+ ]
66
+ },
67
+ uk: { // Ukrainian
68
+ months: [
69
+ 'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'
70
+ ],
71
+ dayOfWeek: [
72
+ "Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт"
73
+ ]
74
+ },
75
+ en: { // English
76
+ months: [
77
+ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
78
+ ],
79
+ dayOfWeek: [
80
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
81
+ ]
82
+ },
83
+ el: { // Ελληνικά
84
+ months: [
85
+ "Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"
86
+ ],
87
+ dayOfWeek: [
88
+ "Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ"
89
+ ]
90
+ },
91
+ de: { // German
92
+ months: [
93
+ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
94
+ ],
95
+ dayOfWeek: [
96
+ "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"
97
+ ]
98
+ },
99
+ nl: { // Dutch
100
+ months: [
101
+ "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"
102
+ ],
103
+ dayOfWeek: [
104
+ "zo", "ma", "di", "wo", "do", "vr", "za"
105
+ ]
106
+ },
107
+ tr: { // Turkish
108
+ months: [
109
+ "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
110
+ ],
111
+ dayOfWeek: [
112
+ "Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"
113
+ ]
114
+ },
115
+ fr: { //French
116
+ months: [
117
+ "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
118
+ ],
119
+ dayOfWeek: [
120
+ "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"
121
+ ]
122
+ },
123
+ es: { // Spanish
124
+ months: [
125
+ "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
126
+ ],
127
+ dayOfWeek: [
128
+ "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"
129
+ ]
130
+ },
131
+ th: { // Thai
132
+ months: [
133
+ 'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'
134
+ ],
135
+ dayOfWeek: [
136
+ 'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'
137
+ ]
138
+ },
139
+ pl: { // Polish
140
+ months: [
141
+ "styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień"
142
+ ],
143
+ dayOfWeek: [
144
+ "nd", "pn", "wt", "śr", "cz", "pt", "sb"
145
+ ]
146
+ },
147
+ pt: { // Portuguese
148
+ months: [
149
+ "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
150
+ ],
151
+ dayOfWeek: [
152
+ "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"
153
+ ]
154
+ },
155
+ ch: { // Simplified Chinese
156
+ months: [
157
+ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
158
+ ],
159
+ dayOfWeek: [
160
+ "日", "一", "二", "三", "四", "五", "六"
161
+ ]
162
+ },
163
+ se: { // Swedish
164
+ months: [
165
+ "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
166
+ ],
167
+ dayOfWeek: [
168
+ "Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
169
+ ]
170
+ },
171
+ kr: { // Korean
172
+ months: [
173
+ "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
174
+ ],
175
+ dayOfWeek: [
176
+ "일", "월", "화", "수", "목", "금", "토"
177
+ ]
178
+ },
179
+ it: { // Italian
180
+ months: [
181
+ "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"
182
+ ],
183
+ dayOfWeek: [
184
+ "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"
185
+ ]
186
+ },
187
+ da: { // Dansk
188
+ months: [
189
+ "January", "Februar", "Marts", "April", "Maj", "Juni", "July", "August", "September", "Oktober", "November", "December"
190
+ ],
191
+ dayOfWeek: [
192
+ "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
193
+ ]
194
+ },
195
+ no: { // Norwegian
196
+ months: [
197
+ "Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"
198
+ ],
199
+ dayOfWeek: [
200
+ "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
201
+ ]
202
+ },
203
+ ja: { // Japanese
204
+ months: [
205
+ "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"
206
+ ],
207
+ dayOfWeek: [
208
+ "日", "月", "火", "水", "木", "金", "土"
209
+ ]
210
+ },
211
+ vi: { // Vietnamese
212
+ months: [
213
+ "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
+ ],
215
+ dayOfWeek: [
216
+ "CN", "T2", "T3", "T4", "T5", "T6", "T7"
217
+ ]
218
+ },
219
+ sl: { // Slovenščina
220
+ months: [
221
+ "Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"
222
+ ],
223
+ dayOfWeek: [
224
+ "Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"
225
+ ]
226
+ },
227
+ cs: { // Čeština
228
+ months: [
229
+ "Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"
230
+ ],
231
+ dayOfWeek: [
232
+ "Ne", "Po", "Út", "St", "Čt", "Pá", "So"
233
+ ]
234
+ },
235
+ hu: { // Hungarian
236
+ months: [
237
+ "Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"
238
+ ],
239
+ dayOfWeek: [
240
+ "Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo"
241
+ ]
242
+ },
243
+ az: { //Azerbaijanian (Azeri)
244
+ months: [
245
+ "Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr"
246
+ ],
247
+ dayOfWeek: [
248
+ "B", "Be", "Ça", "Ç", "Ca", "C", "Ş"
249
+ ]
250
+ },
251
+ bs: { //Bosanski
252
+ months: [
253
+ "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
254
+ ],
255
+ dayOfWeek: [
256
+ "Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
257
+ ]
258
+ },
259
+ ca: { //Català
260
+ months: [
261
+ "Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"
262
+ ],
263
+ dayOfWeek: [
264
+ "Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds"
265
+ ]
266
+ },
267
+ 'en-GB': { //English (British)
268
+ months: [
269
+ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
270
+ ],
271
+ dayOfWeek: [
272
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
273
+ ]
274
+ },
275
+ et: { //"Eesti"
276
+ months: [
277
+ "Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"
278
+ ],
279
+ dayOfWeek: [
280
+ "P", "E", "T", "K", "N", "R", "L"
281
+ ]
282
+ },
283
+ eu: { //Euskara
284
+ months: [
285
+ "Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua"
286
+ ],
287
+ dayOfWeek: [
288
+ "Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La."
289
+ ]
290
+ },
291
+ fi: { //Finnish (Suomi)
292
+ months: [
293
+ "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"
294
+ ],
295
+ dayOfWeek: [
296
+ "Su", "Ma", "Ti", "Ke", "To", "Pe", "La"
297
+ ]
298
+ },
299
+ gl: { //Galego
300
+ months: [
301
+ "Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec"
302
+ ],
303
+ dayOfWeek: [
304
+ "Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab"
305
+ ]
306
+ },
307
+ hr: { //Hrvatski
308
+ months: [
309
+ "Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"
310
+ ],
311
+ dayOfWeek: [
312
+ "Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
313
+ ]
314
+ },
315
+ ko: { //Korean (한국어)
316
+ months: [
317
+ "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
318
+ ],
319
+ dayOfWeek: [
320
+ "일", "월", "화", "수", "목", "금", "토"
321
+ ]
322
+ },
323
+ lt: { //Lithuanian (lietuvių)
324
+ months: [
325
+ "Sausio", "Vasario", "Kovo", "Balandžio", "Gegužės", "Birželio", "Liepos", "Rugpjūčio", "Rugsėjo", "Spalio", "Lapkričio", "Gruodžio"
326
+ ],
327
+ dayOfWeek: [
328
+ "Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš"
329
+ ]
330
+ },
331
+ lv: { //Latvian (Latviešu)
332
+ months: [
333
+ "Janvāris", "Februāris", "Marts", "Aprīlis ", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"
334
+ ],
335
+ dayOfWeek: [
336
+ "Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St"
337
+ ]
338
+ },
339
+ mk: { //Macedonian (Македонски)
340
+ months: [
341
+ "јануари", "февруари", "март", "април", "мај", "јуни", "јули", "август", "септември", "октомври", "ноември", "декември"
342
+ ],
343
+ dayOfWeek: [
344
+ "нед", "пон", "вто", "сре", "чет", "пет", "саб"
345
+ ]
346
+ },
347
+ mn: { //Mongolian (Монгол)
348
+ months: [
349
+ "1-р сар", "2-р сар", "3-р сар", "4-р сар", "5-р сар", "6-р сар", "7-р сар", "8-р сар", "9-р сар", "10-р сар", "11-р сар", "12-р сар"
350
+ ],
351
+ dayOfWeek: [
352
+ "Дав", "Мяг", "Лха", "Пүр", "Бсн", "Бям", "Ням"
353
+ ]
354
+ },
355
+ 'pt-BR': { //Português(Brasil)
356
+ months: [
357
+ "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
358
+ ],
359
+ dayOfWeek: [
360
+ "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"
361
+ ]
362
+ },
363
+ sk: { //Slovenčina
364
+ months: [
365
+ "Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"
366
+ ],
367
+ dayOfWeek: [
368
+ "Ne", "Po", "Ut", "St", "Št", "Pi", "So"
369
+ ]
370
+ },
371
+ sq: { //Albanian (Shqip)
372
+ months: [
373
+ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
374
+ ],
375
+ dayOfWeek: [
376
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
377
+ ]
378
+ },
379
+ 'sr-YU': { //Serbian (Srpski)
380
+ months: [
381
+ "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
382
+ ],
383
+ dayOfWeek: [
384
+ "Ned", "Pon", "Uto", "Sre", "čet", "Pet", "Sub"
385
+ ]
386
+ },
387
+ sr: { //Serbian Cyrillic (Српски)
388
+ months: [
389
+ "јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар"
390
+ ],
391
+ dayOfWeek: [
392
+ "нед", "пон", "уто", "сре", "чет", "пет", "суб"
393
+ ]
394
+ },
395
+ sv: { //Svenska
396
+ months: [
397
+ "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
398
+ ],
399
+ dayOfWeek: [
400
+ "Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
401
+ ]
402
+ },
403
+ 'zh-TW': { //Traditional Chinese (繁體中文)
404
+ months: [
405
+ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
406
+ ],
407
+ dayOfWeek: [
408
+ "日", "一", "二", "三", "四", "五", "六"
409
+ ]
410
+ },
411
+ zh: { //Simplified Chinese (简体中文)
412
+ months: [
413
+ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
414
+ ],
415
+ dayOfWeek: [
416
+ "日", "一", "二", "三", "四", "五", "六"
417
+ ]
418
+ },
419
+ he: { //Hebrew (עברית)
420
+ months: [
421
+ 'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'
422
+ ],
423
+ dayOfWeek: [
424
+ 'א\'', 'ב\'', 'ג\'', 'ד\'', 'ה\'', 'ו\'', 'שבת'
425
+ ]
426
+ },
427
+ hy: { // Armenian
428
+ months: [
429
+ "Հունվար", "Փետրվար", "Մարտ", "Ապրիլ", "Մայիս", "Հունիս", "Հուլիս", "Օգոստոս", "Սեպտեմբեր", "Հոկտեմբեր", "Նոյեմբեր", "Դեկտեմբեր"
430
+ ],
431
+ dayOfWeek: [
432
+ "Կի", "Երկ", "Երք", "Չոր", "Հնգ", "Ուրբ", "Շբթ"
433
+ ]
434
+ },
435
+ kg: { // Kyrgyz
436
+ months: [
437
+ 'Үчтүн айы', 'Бирдин айы', 'Жалган Куран', 'Чын Куран', 'Бугу', 'Кулжа', 'Теке', 'Баш Оона', 'Аяк Оона', 'Тогуздун айы', 'Жетинин айы', 'Бештин айы'
438
+ ],
439
+ dayOfWeek: [
440
+ "Жек", "Дүй", "Шей", "Шар", "Бей", "Жум", "Ише"
441
+ ]
442
+ }
443
+ },
444
+ value: '',
445
+ lang: 'en',
446
+ rtl: false,
447
+
448
+ format: 'Y/m/d H:i',
449
+ formatTime: 'H:i',
450
+ formatDate: 'Y/m/d',
451
+
452
+ startDate: false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05',
453
+ step: 60,
454
+ monthChangeSpinner: true,
455
+
456
+ closeOnDateSelect: false,
457
+ closeOnTimeSelect: true,
458
+ closeOnWithoutClick: true,
459
+ closeOnInputClick: true,
460
+
461
+ timepicker: true,
462
+ datepicker: true,
463
+ weeks: false,
464
+
465
+ defaultTime: false, // use formatTime format (ex. '10:00' for formatTime: 'H:i')
466
+ defaultDate: false, // use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05')
467
+
468
+ minDate: false,
469
+ maxDate: false,
470
+ minTime: false,
471
+ maxTime: false,
472
+ disabledMinTime: false,
473
+ disabledMaxTime: false,
474
+
475
+ allowTimes: [],
476
+ opened: false,
477
+ initTime: true,
478
+ inline: false,
479
+ theme: '',
480
+
481
+ onSelectDate: function () {},
482
+ onSelectTime: function () {},
483
+ onChangeMonth: function () {},
484
+ onChangeYear: function () {},
485
+ onChangeDateTime: function () {},
486
+ onShow: function () {},
487
+ onClose: function () {},
488
+ onGenerate: function () {},
489
+
490
+ withoutCopyright: true,
491
+ inverseButton: false,
492
+ hours12: false,
493
+ next: 'xdsoft_next',
494
+ prev : 'xdsoft_prev',
495
+ dayOfWeekStart: 0,
496
+ parentID: 'body',
497
+ timeHeightInTimePicker: 25,
498
+ timepickerScrollbar: true,
499
+ todayButton: true,
500
+ prevButton: true,
501
+ nextButton: true,
502
+ defaultSelect: true,
503
+
504
+ scrollMonth: true,
505
+ scrollTime: true,
506
+ scrollInput: true,
507
+
508
+ lazyInit: false,
509
+ mask: false,
510
+ validateOnBlur: true,
511
+ allowBlank: true,
512
+ yearStart: 1950,
513
+ yearEnd: 2050,
514
+ monthStart: 0,
515
+ monthEnd: 11,
516
+ style: '',
517
+ id: '',
518
+ fixed: false,
519
+ roundTime: 'round', // ceil, floor
520
+ className: '',
521
+ weekends: [],
522
+ highlightedDates: [],
523
+ highlightedPeriods: [],
524
+ disabledDates : [],
525
+ disabledWeekDays: [],
526
+ yearOffset: 0,
527
+ beforeShowDay: null,
528
+
529
+ enterLikeTab: true,
530
+ showApplyButton: false
531
+ };
532
+ // fix for ie8
533
+ if (!window.getComputedStyle) {
534
+ window.getComputedStyle = function (el, pseudo) {
535
+ this.el = el;
536
+ this.getPropertyValue = function (prop) {
537
+ var re = /(\-([a-z]){1})/g;
538
+ if (prop === 'float') {
539
+ prop = 'styleFloat';
540
+ }
541
+ if (re.test(prop)) {
542
+ prop = prop.replace(re, function (a, b, c) {
543
+ return c.toUpperCase();
544
+ });
545
+ }
546
+ return el.currentStyle[prop] || null;
547
+ };
548
+ return this;
549
+ };
550
+ }
551
+ if (!Array.prototype.indexOf) {
552
+ Array.prototype.indexOf = function (obj, start) {
553
+ var i, j;
554
+ for (i = (start || 0), j = this.length; i < j; i += 1) {
555
+ if (this[i] === obj) { return i; }
556
+ }
557
+ return -1;
558
+ };
559
+ }
560
+ Date.prototype.countDaysInMonth = function () {
561
+ return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate();
562
+ };
563
+ $.fn.xdsoftScroller = function (percent) {
564
+ return this.each(function () {
565
+ var timeboxparent = $(this),
566
+ pointerEventToXY = function (e) {
567
+ var out = {x: 0, y: 0},
568
+ touch;
569
+ if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') {
570
+ touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
571
+ out.x = touch.clientX;
572
+ out.y = touch.clientY;
573
+ } else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') {
574
+ out.x = e.clientX;
575
+ out.y = e.clientY;
576
+ }
577
+ return out;
578
+ },
579
+ move = 0,
580
+ timebox,
581
+ parentHeight,
582
+ height,
583
+ scrollbar,
584
+ scroller,
585
+ maximumOffset = 100,
586
+ start = false,
587
+ startY = 0,
588
+ startTop = 0,
589
+ h1 = 0,
590
+ touchStart = false,
591
+ startTopScroll = 0,
592
+ calcOffset = function () {};
593
+ if (percent === 'hide') {
594
+ timeboxparent.find('.xdsoft_scrollbar').hide();
595
+ return;
596
+ }
597
+ if (!$(this).hasClass('xdsoft_scroller_box')) {
598
+ timebox = timeboxparent.children().eq(0);
599
+ parentHeight = timeboxparent[0].clientHeight;
600
+ height = timebox[0].offsetHeight;
601
+ scrollbar = $('<div class="xdsoft_scrollbar"></div>');
602
+ scroller = $('<div class="xdsoft_scroller"></div>');
603
+ scrollbar.append(scroller);
604
+
605
+ timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar);
606
+ calcOffset = function calcOffset(event) {
607
+ var offset = pointerEventToXY(event).y - startY + startTopScroll;
608
+ if (offset < 0) {
609
+ offset = 0;
610
+ }
611
+ if (offset + scroller[0].offsetHeight > h1) {
612
+ offset = h1 - scroller[0].offsetHeight;
613
+ }
614
+ timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]);
615
+ };
616
+
617
+ scroller
618
+ .on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) {
619
+ if (!parentHeight) {
620
+ timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
621
+ }
622
+
623
+ startY = pointerEventToXY(event).y;
624
+ startTopScroll = parseInt(scroller.css('margin-top'), 10);
625
+ h1 = scrollbar[0].offsetHeight;
626
+
627
+ if (event.type === 'mousedown') {
628
+ if (document) {
629
+ $(document.body).addClass('xdsoft_noselect');
630
+ }
631
+ $([document.body, window]).on('mouseup.xdsoft_scroller', function arguments_callee() {
632
+ $([document.body, window]).off('mouseup.xdsoft_scroller', arguments_callee)
633
+ .off('mousemove.xdsoft_scroller', calcOffset)
634
+ .removeClass('xdsoft_noselect');
635
+ });
636
+ $(document.body).on('mousemove.xdsoft_scroller', calcOffset);
637
+ } else {
638
+ touchStart = true;
639
+ event.stopPropagation();
640
+ event.preventDefault();
641
+ }
642
+ })
643
+ .on('touchmove', function (event) {
644
+ if (touchStart) {
645
+ event.preventDefault();
646
+ calcOffset(event);
647
+ }
648
+ })
649
+ .on('touchend touchcancel', function (event) {
650
+ touchStart = false;
651
+ startTopScroll = 0;
652
+ });
653
+
654
+ timeboxparent
655
+ .on('scroll_element.xdsoft_scroller', function (event, percentage) {
656
+ if (!parentHeight) {
657
+ timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]);
658
+ }
659
+ percentage = percentage > 1 ? 1 : (percentage < 0 || isNaN(percentage)) ? 0 : percentage;
660
+
661
+ scroller.css('margin-top', maximumOffset * percentage);
662
+
663
+ setTimeout(function () {
664
+ timebox.css('marginTop', -parseInt((timebox[0].offsetHeight - parentHeight) * percentage, 10));
665
+ }, 10);
666
+ })
667
+ .on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) {
668
+ var percent, sh;
669
+ parentHeight = timeboxparent[0].clientHeight;
670
+ height = timebox[0].offsetHeight;
671
+ percent = parentHeight / height;
672
+ sh = percent * scrollbar[0].offsetHeight;
673
+ if (percent > 1) {
674
+ scroller.hide();
675
+ } else {
676
+ scroller.show();
677
+ scroller.css('height', parseInt(sh > 10 ? sh : 10, 10));
678
+ maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight;
679
+ if (noTriggerScroll !== true) {
680
+ timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || Math.abs(parseInt(timebox.css('marginTop'), 10)) / (height - parentHeight)]);
681
+ }
682
+ }
683
+ });
684
+
685
+ timeboxparent.on('mousewheel', function (event) {
686
+ var top = Math.abs(parseInt(timebox.css('marginTop'), 10));
687
+
688
+ top = top - (event.deltaY * 20);
689
+ if (top < 0) {
690
+ top = 0;
691
+ }
692
+
693
+ timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]);
694
+ event.stopPropagation();
695
+ return false;
696
+ });
697
+
698
+ timeboxparent.on('touchstart', function (event) {
699
+ start = pointerEventToXY(event);
700
+ startTop = Math.abs(parseInt(timebox.css('marginTop'), 10));
701
+ });
702
+
703
+ timeboxparent.on('touchmove', function (event) {
704
+ if (start) {
705
+ event.preventDefault();
706
+ var coord = pointerEventToXY(event);
707
+ timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]);
708
+ }
709
+ });
710
+
711
+ timeboxparent.on('touchend touchcancel', function (event) {
712
+ start = false;
713
+ startTop = 0;
714
+ });
715
+ }
716
+ timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
717
+ });
718
+ };
719
+
720
+ $.fn.datetimepicker = function (opt) {
721
+ var KEY0 = 48,
722
+ KEY9 = 57,
723
+ _KEY0 = 96,
724
+ _KEY9 = 105,
725
+ CTRLKEY = 17,
726
+ DEL = 46,
727
+ ENTER = 13,
728
+ ESC = 27,
729
+ BACKSPACE = 8,
730
+ ARROWLEFT = 37,
731
+ ARROWUP = 38,
732
+ ARROWRIGHT = 39,
733
+ ARROWDOWN = 40,
734
+ TAB = 9,
735
+ F5 = 116,
736
+ AKEY = 65,
737
+ CKEY = 67,
738
+ VKEY = 86,
739
+ ZKEY = 90,
740
+ YKEY = 89,
741
+ ctrlDown = false,
742
+ options = ($.isPlainObject(opt) || !opt) ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options),
743
+
744
+ lazyInitTimer = 0,
745
+ createDateTimePicker,
746
+ destroyDateTimePicker,
747
+
748
+ lazyInit = function (input) {
749
+ input
750
+ .on('open.xdsoft focusin.xdsoft mousedown.xdsoft', function initOnActionCallback(event) {
751
+ if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) {
752
+ return;
753
+ }
754
+ clearTimeout(lazyInitTimer);
755
+ lazyInitTimer = setTimeout(function () {
756
+
757
+ if (!input.data('xdsoft_datetimepicker')) {
758
+ createDateTimePicker(input);
759
+ }
760
+ input
761
+ .off('open.xdsoft focusin.xdsoft mousedown.xdsoft', initOnActionCallback)
762
+ .trigger('open.xdsoft');
763
+ }, 100);
764
+ });
765
+ };
766
+
767
+ createDateTimePicker = function (input) {
768
+ var datetimepicker = $('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'),
769
+ xdsoft_copyright = $('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),
770
+ datepicker = $('<div class="xdsoft_datepicker active"></div>'),
771
+ mounth_picker = $('<div class="xdsoft_mounthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button>' +
772
+ '<div class="xdsoft_label xdsoft_month"><span></span><i></i></div>' +
773
+ '<div class="xdsoft_label xdsoft_year"><span></span><i></i></div>' +
774
+ '<button type="button" class="xdsoft_next"></button></div>'),
775
+ calendar = $('<div class="xdsoft_calendar"></div>'),
776
+ timepicker = $('<div class="xdsoft_timepicker active"><button type="button" class="xdsoft_prev"></button><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div>'),
777
+ timeboxparent = timepicker.find('.xdsoft_time_box').eq(0),
778
+ timebox = $('<div class="xdsoft_time_variant"></div>'),
779
+ applyButton = $('<button type="button" class="xdsoft_save_selected blue-gradient-button">Save Selected</button>'),
780
+ /*scrollbar = $('<div class="xdsoft_scrollbar"></div>'),
781
+ scroller = $('<div class="xdsoft_scroller"></div>'),*/
782
+ monthselect = $('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),
783
+ yearselect = $('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),
784
+ triggerAfterOpen = false,
785
+ XDSoft_datetime,
786
+ //scroll_element,
787
+ xchangeTimer,
788
+ timerclick,
789
+ current_time_index,
790
+ setPos,
791
+ timer = 0,
792
+ timer1 = 0,
793
+ _xdsoft_datetime;
794
+
795
+ if (options.id) {
796
+ datetimepicker.attr('id', options.id);
797
+ }
798
+ if (options.style) {
799
+ datetimepicker.attr('style', options.style);
800
+ }
801
+ if (options.weeks) {
802
+ datetimepicker.addClass('xdsoft_showweeks');
803
+ }
804
+ if (options.rtl) {
805
+ datetimepicker.addClass('xdsoft_rtl');
806
+ }
807
+
808
+ datetimepicker.addClass('xdsoft_' + options.theme);
809
+ datetimepicker.addClass(options.className);
810
+
811
+ mounth_picker
812
+ .find('.xdsoft_month span')
813
+ .after(monthselect);
814
+ mounth_picker
815
+ .find('.xdsoft_year span')
816
+ .after(yearselect);
817
+
818
+ mounth_picker
819
+ .find('.xdsoft_month,.xdsoft_year')
820
+ .on('mousedown.xdsoft', function (event) {
821
+ var select = $(this).find('.xdsoft_select').eq(0),
822
+ val = 0,
823
+ top = 0,
824
+ visible = select.is(':visible'),
825
+ items,
826
+ i;
827
+
828
+ mounth_picker
829
+ .find('.xdsoft_select')
830
+ .hide();
831
+ if (_xdsoft_datetime.currentTime) {
832
+ val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear']();
833
+ }
834
+
835
+ select[visible ? 'hide' : 'show']();
836
+ for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) {
837
+ if (items.eq(i).data('value') === val) {
838
+ break;
839
+ } else {
840
+ top += items[0].offsetHeight;
841
+ }
842
+ }
843
+
844
+ select.xdsoftScroller(top / (select.children()[0].offsetHeight - (select[0].clientHeight)));
845
+ event.stopPropagation();
846
+ return false;
847
+ });
848
+
849
+ mounth_picker
850
+ .find('.xdsoft_select')
851
+ .xdsoftScroller()
852
+ .on('mousedown.xdsoft', function (event) {
853
+ event.stopPropagation();
854
+ event.preventDefault();
855
+ })
856
+ .on('mousedown.xdsoft', '.xdsoft_option', function (event) {
857
+
858
+ if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
859
+ _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
860
+ }
861
+
862
+ var year = _xdsoft_datetime.currentTime.getFullYear();
863
+ if (_xdsoft_datetime && _xdsoft_datetime.currentTime) {
864
+ _xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value'));
865
+ }
866
+
867
+ $(this).parent().parent().hide();
868
+
869
+ datetimepicker.trigger('xchange.xdsoft');
870
+ if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
871
+ options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
872
+ }
873
+
874
+ if (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
875
+ options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
876
+ }
877
+ });
878
+
879
+ datetimepicker.setOptions = function (_options) {
880
+ var highlightedDates = {},
881
+ getCaretPos = function (input) {
882
+ try {
883
+ if (document.selection && document.selection.createRange) {
884
+ var range = document.selection.createRange();
885
+ return range.getBookmark().charCodeAt(2) - 2;
886
+ }
887
+ if (input.setSelectionRange) {
888
+ return input.selectionStart;
889
+ }
890
+ } catch (e) {
891
+ return 0;
892
+ }
893
+ },
894
+ setCaretPos = function (node, pos) {
895
+ node = (typeof node === "string" || node instanceof String) ? document.getElementById(node) : node;
896
+ if (!node) {
897
+ return false;
898
+ }
899
+ if (node.createTextRange) {
900
+ var textRange = node.createTextRange();
901
+ textRange.collapse(true);
902
+ textRange.moveEnd('character', pos);
903
+ textRange.moveStart('character', pos);
904
+ textRange.select();
905
+ return true;
906
+ }
907
+ if (node.setSelectionRange) {
908
+ node.setSelectionRange(pos, pos);
909
+ return true;
910
+ }
911
+ return false;
912
+ },
913
+ isValidValue = function (mask, value) {
914
+ var reg = mask
915
+ .replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1')
916
+ .replace(/_/g, '{digit+}')
917
+ .replace(/([0-9]{1})/g, '{digit$1}')
918
+ .replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}')
919
+ .replace(/\{digit[\+]\}/g, '[0-9_]{1}');
920
+ return (new RegExp(reg)).test(value);
921
+ };
922
+ options = $.extend(true, {}, options, _options);
923
+
924
+ if (_options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length) {
925
+ options.allowTimes = $.extend(true, [], _options.allowTimes);
926
+ }
927
+
928
+ if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) {
929
+ options.weekends = $.extend(true, [], _options.weekends);
930
+ }
931
+
932
+ if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) {
933
+ $.each(_options.highlightedDates, function (index, value) {
934
+ var splitData = $.map(value.split(','), $.trim),
935
+ exDesc,
936
+ hDate = new HighlightedDate(Date.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]), // date, desc, style
937
+ keyDate = hDate.date.dateFormat(options.formatDate);
938
+ if (highlightedDates[keyDate] !== undefined) {
939
+ exDesc = highlightedDates[keyDate].desc;
940
+ if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
941
+ highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
942
+ }
943
+ } else {
944
+ highlightedDates[keyDate] = hDate;
945
+ }
946
+ });
947
+
948
+ options.highlightedDates = $.extend(true, [], highlightedDates);
949
+ }
950
+
951
+ if (_options.highlightedPeriods && $.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) {
952
+ highlightedDates = $.extend(true, [], options.highlightedDates);
953
+ $.each(_options.highlightedPeriods, function (index, value) {
954
+ var splitData = $.map(value.split(','), $.trim),
955
+ dateTest = Date.parseDate(splitData[0], options.formatDate), // start date
956
+ dateEnd = Date.parseDate(splitData[1], options.formatDate),
957
+ desc = splitData[2],
958
+ hDate,
959
+ keyDate,
960
+ exDesc,
961
+ style = splitData[3];
962
+
963
+ while (dateTest <= dateEnd) {
964
+ hDate = new HighlightedDate(dateTest, desc, style);
965
+ keyDate = dateTest.dateFormat(options.formatDate);
966
+ dateTest.setDate(dateTest.getDate() + 1);
967
+ if (highlightedDates[keyDate] !== undefined) {
968
+ exDesc = highlightedDates[keyDate].desc;
969
+ if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
970
+ highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
971
+ }
972
+ } else {
973
+ highlightedDates[keyDate] = hDate;
974
+ }
975
+ }
976
+ });
977
+
978
+ options.highlightedDates = $.extend(true, [], highlightedDates);
979
+ }
980
+
981
+ if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) {
982
+ options.disabledDates = $.extend(true, [], _options.disabledDates);
983
+ }
984
+
985
+ if (_options.disabledWeekDays && $.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) {
986
+ options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays);
987
+ }
988
+
989
+ if ((options.open || options.opened) && (!options.inline)) {
990
+ input.trigger('open.xdsoft');
991
+ }
992
+
993
+ if (options.inline) {
994
+ triggerAfterOpen = true;
995
+ datetimepicker.addClass('xdsoft_inline');
996
+ input.after(datetimepicker).hide();
997
+ }
998
+
999
+ if (options.inverseButton) {
1000
+ options.next = 'xdsoft_prev';
1001
+ options.prev = 'xdsoft_next';
1002
+ }
1003
+
1004
+ if (options.datepicker) {
1005
+ datepicker.addClass('active');
1006
+ } else {
1007
+ datepicker.removeClass('active');
1008
+ }
1009
+
1010
+ if (options.timepicker) {
1011
+ timepicker.addClass('active');
1012
+ } else {
1013
+ timepicker.removeClass('active');
1014
+ }
1015
+
1016
+ if (options.value) {
1017
+ _xdsoft_datetime.setCurrentTime(options.value);
1018
+ if (input && input.val) {
1019
+ input.val(_xdsoft_datetime.str);
1020
+ }
1021
+ }
1022
+
1023
+ if (isNaN(options.dayOfWeekStart)) {
1024
+ options.dayOfWeekStart = 0;
1025
+ } else {
1026
+ options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7;
1027
+ }
1028
+
1029
+ if (!options.timepickerScrollbar) {
1030
+ timeboxparent.xdsoftScroller('hide');
1031
+ }
1032
+
1033
+ if (options.minDate && /^[\+\-](.*)$/.test(options.minDate)) {
1034
+ options.minDate = _xdsoft_datetime.strToDateTime(options.minDate).dateFormat(options.formatDate);
1035
+ }
1036
+
1037
+ if (options.maxDate && /^[\+\-](.*)$/.test(options.maxDate)) {
1038
+ options.maxDate = _xdsoft_datetime.strToDateTime(options.maxDate).dateFormat(options.formatDate);
1039
+ }
1040
+
1041
+ applyButton.toggle(options.showApplyButton);
1042
+
1043
+ mounth_picker
1044
+ .find('.xdsoft_today_button')
1045
+ .css('visibility', !options.todayButton ? 'hidden' : 'visible');
1046
+
1047
+ mounth_picker
1048
+ .find('.' + options.prev)
1049
+ .css('visibility', !options.prevButton ? 'hidden' : 'visible');
1050
+
1051
+ mounth_picker
1052
+ .find('.' + options.next)
1053
+ .css('visibility', !options.nextButton ? 'hidden' : 'visible');
1054
+
1055
+ if (options.mask) {
1056
+ input.off('keydown.xdsoft');
1057
+
1058
+ if (options.mask === true) {
1059
+ options.mask = options.format
1060
+ .replace(/Y/g, '9999')
1061
+ .replace(/F/g, '9999')
1062
+ .replace(/m/g, '19')
1063
+ .replace(/d/g, '39')
1064
+ .replace(/H/g, '29')
1065
+ .replace(/i/g, '59')
1066
+ .replace(/s/g, '59');
1067
+ }
1068
+
1069
+ if ($.type(options.mask) === 'string') {
1070
+ if (!isValidValue(options.mask, input.val())) {
1071
+ input.val(options.mask.replace(/[0-9]/g, '_'));
1072
+ }
1073
+
1074
+ input.on('keydown.xdsoft', function (event) {
1075
+ var val = this.value,
1076
+ key = event.which,
1077
+ pos,
1078
+ digit;
1079
+
1080
+ if (((key >= KEY0 && key <= KEY9) || (key >= _KEY0 && key <= _KEY9)) || (key === BACKSPACE || key === DEL)) {
1081
+ pos = getCaretPos(this);
1082
+ digit = (key !== BACKSPACE && key !== DEL) ? String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key) : '_';
1083
+
1084
+ if ((key === BACKSPACE || key === DEL) && pos) {
1085
+ pos -= 1;
1086
+ digit = '_';
1087
+ }
1088
+
1089
+ while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
1090
+ pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
1091
+ }
1092
+
1093
+ val = val.substr(0, pos) + digit + val.substr(pos + 1);
1094
+ if ($.trim(val) === '') {
1095
+ val = options.mask.replace(/[0-9]/g, '_');
1096
+ } else {
1097
+ if (pos === options.mask.length) {
1098
+ event.preventDefault();
1099
+ return false;
1100
+ }
1101
+ }
1102
+
1103
+ pos += (key === BACKSPACE || key === DEL) ? 0 : 1;
1104
+ while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
1105
+ pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
1106
+ }
1107
+
1108
+ if (isValidValue(options.mask, val)) {
1109
+ this.value = val;
1110
+ setCaretPos(this, pos);
1111
+ } else if ($.trim(val) === '') {
1112
+ this.value = options.mask.replace(/[0-9]/g, '_');
1113
+ } else {
1114
+ input.trigger('error_input.xdsoft');
1115
+ }
1116
+ } else {
1117
+ if (([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown) || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) {
1118
+ return true;
1119
+ }
1120
+ }
1121
+
1122
+ event.preventDefault();
1123
+ return false;
1124
+ });
1125
+ }
1126
+ }
1127
+ if (options.validateOnBlur) {
1128
+ input
1129
+ .off('blur.xdsoft')
1130
+ .on('blur.xdsoft', function () {
1131
+ if (options.allowBlank && !$.trim($(this).val()).length) {
1132
+ $(this).val(null);
1133
+ datetimepicker.data('xdsoft_datetime').empty();
1134
+ } else if (!Date.parseDate($(this).val(), options.format)) {
1135
+ var splittedHours = +([$(this).val()[0], $(this).val()[1]].join('')),
1136
+ splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join(''));
1137
+
1138
+ // parse the numbers as 0312 => 03:12
1139
+ if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) {
1140
+ $(this).val([splittedHours, splittedMinutes].map(function (item) {
1141
+ return item > 9 ? item : '0' + item;
1142
+ }).join(':'));
1143
+ } else {
1144
+ $(this).val((_xdsoft_datetime.now()).dateFormat(options.format));
1145
+ }
1146
+
1147
+ datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
1148
+ } else {
1149
+ datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
1150
+ }
1151
+
1152
+ datetimepicker.trigger('changedatetime.xdsoft');
1153
+ });
1154
+ }
1155
+ options.dayOfWeekStartPrev = (options.dayOfWeekStart === 0) ? 6 : options.dayOfWeekStart - 1;
1156
+
1157
+ datetimepicker
1158
+ .trigger('xchange.xdsoft')
1159
+ .trigger('afterOpen.xdsoft');
1160
+ };
1161
+
1162
+ datetimepicker
1163
+ .data('options', options)
1164
+ .on('mousedown.xdsoft', function (event) {
1165
+ event.stopPropagation();
1166
+ event.preventDefault();
1167
+ yearselect.hide();
1168
+ monthselect.hide();
1169
+ return false;
1170
+ });
1171
+
1172
+ //scroll_element = timepicker.find('.xdsoft_time_box');
1173
+ timeboxparent.append(timebox);
1174
+ timeboxparent.xdsoftScroller();
1175
+
1176
+ datetimepicker.on('afterOpen.xdsoft', function () {
1177
+ timeboxparent.xdsoftScroller();
1178
+ });
1179
+
1180
+ datetimepicker
1181
+ .append(datepicker)
1182
+ .append(timepicker);
1183
+
1184
+ if (options.withoutCopyright !== true) {
1185
+ datetimepicker
1186
+ .append(xdsoft_copyright);
1187
+ }
1188
+
1189
+ datepicker
1190
+ .append(mounth_picker)
1191
+ .append(calendar)
1192
+ .append(applyButton);
1193
+
1194
+ $(options.parentID)
1195
+ .append(datetimepicker);
1196
+
1197
+ XDSoft_datetime = function () {
1198
+ var _this = this;
1199
+ _this.now = function (norecursion) {
1200
+ var d = new Date(),
1201
+ date,
1202
+ time;
1203
+
1204
+ if (!norecursion && options.defaultDate) {
1205
+ date = _this.strToDateTime(options.defaultDate);
1206
+ d.setFullYear(date.getFullYear());
1207
+ d.setMonth(date.getMonth());
1208
+ d.setDate(date.getDate());
1209
+ }
1210
+
1211
+ if (options.yearOffset) {
1212
+ d.setFullYear(d.getFullYear() + options.yearOffset);
1213
+ }
1214
+
1215
+ if (!norecursion && options.defaultTime) {
1216
+ time = _this.strtotime(options.defaultTime);
1217
+ d.setHours(time.getHours());
1218
+ d.setMinutes(time.getMinutes());
1219
+ }
1220
+ return d;
1221
+ };
1222
+
1223
+ _this.isValidDate = function (d) {
1224
+ if (Object.prototype.toString.call(d) !== "[object Date]") {
1225
+ return false;
1226
+ }
1227
+ return !isNaN(d.getTime());
1228
+ };
1229
+
1230
+ _this.setCurrentTime = function (dTime) {
1231
+ _this.currentTime = (typeof dTime === 'string') ? _this.strToDateTime(dTime) : _this.isValidDate(dTime) ? dTime : _this.now();
1232
+ datetimepicker.trigger('xchange.xdsoft');
1233
+ };
1234
+
1235
+ _this.empty = function () {
1236
+ _this.currentTime = null;
1237
+ };
1238
+
1239
+ _this.getCurrentTime = function (dTime) {
1240
+ return _this.currentTime;
1241
+ };
1242
+
1243
+ _this.nextMonth = function () {
1244
+
1245
+ if (_this.currentTime === undefined || _this.currentTime === null) {
1246
+ _this.currentTime = _this.now();
1247
+ }
1248
+
1249
+ var month = _this.currentTime.getMonth() + 1,
1250
+ year;
1251
+ if (month === 12) {
1252
+ _this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1);
1253
+ month = 0;
1254
+ }
1255
+
1256
+ year = _this.currentTime.getFullYear();
1257
+
1258
+ _this.currentTime.setDate(
1259
+ Math.min(
1260
+ new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
1261
+ _this.currentTime.getDate()
1262
+ )
1263
+ );
1264
+ _this.currentTime.setMonth(month);
1265
+
1266
+ if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
1267
+ options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1268
+ }
1269
+
1270
+ if (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
1271
+ options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1272
+ }
1273
+
1274
+ datetimepicker.trigger('xchange.xdsoft');
1275
+ return month;
1276
+ };
1277
+
1278
+ _this.prevMonth = function () {
1279
+
1280
+ if (_this.currentTime === undefined || _this.currentTime === null) {
1281
+ _this.currentTime = _this.now();
1282
+ }
1283
+
1284
+ var month = _this.currentTime.getMonth() - 1;
1285
+ if (month === -1) {
1286
+ _this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1);
1287
+ month = 11;
1288
+ }
1289
+ _this.currentTime.setDate(
1290
+ Math.min(
1291
+ new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
1292
+ _this.currentTime.getDate()
1293
+ )
1294
+ );
1295
+ _this.currentTime.setMonth(month);
1296
+ if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
1297
+ options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1298
+ }
1299
+ datetimepicker.trigger('xchange.xdsoft');
1300
+ return month;
1301
+ };
1302
+
1303
+ _this.getWeekOfYear = function (datetime) {
1304
+ var onejan = new Date(datetime.getFullYear(), 0, 1);
1305
+ return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7);
1306
+ };
1307
+
1308
+ _this.strToDateTime = function (sDateTime) {
1309
+ var tmpDate = [], timeOffset, currentTime;
1310
+
1311
+ if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) {
1312
+ return sDateTime;
1313
+ }
1314
+
1315
+ tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime);
1316
+ if (tmpDate) {
1317
+ tmpDate[2] = Date.parseDate(tmpDate[2], options.formatDate);
1318
+ }
1319
+ if (tmpDate && tmpDate[2]) {
1320
+ timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000;
1321
+ currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset);
1322
+ } else {
1323
+ currentTime = sDateTime ? Date.parseDate(sDateTime, options.format) : _this.now();
1324
+ }
1325
+
1326
+ if (!_this.isValidDate(currentTime)) {
1327
+ currentTime = _this.now();
1328
+ }
1329
+
1330
+ return currentTime;
1331
+ };
1332
+
1333
+ _this.strToDate = function (sDate) {
1334
+ if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) {
1335
+ return sDate;
1336
+ }
1337
+
1338
+ var currentTime = sDate ? Date.parseDate(sDate, options.formatDate) : _this.now(true);
1339
+ if (!_this.isValidDate(currentTime)) {
1340
+ currentTime = _this.now(true);
1341
+ }
1342
+ return currentTime;
1343
+ };
1344
+
1345
+ _this.strtotime = function (sTime) {
1346
+ if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) {
1347
+ return sTime;
1348
+ }
1349
+ var currentTime = sTime ? Date.parseDate(sTime, options.formatTime) : _this.now(true);
1350
+ if (!_this.isValidDate(currentTime)) {
1351
+ currentTime = _this.now(true);
1352
+ }
1353
+ return currentTime;
1354
+ };
1355
+
1356
+ _this.str = function () {
1357
+ return _this.currentTime.dateFormat(options.format);
1358
+ };
1359
+ _this.currentTime = this.now();
1360
+ };
1361
+
1362
+ _xdsoft_datetime = new XDSoft_datetime();
1363
+
1364
+ applyButton.on('click', function (e) {//pathbrite
1365
+ e.preventDefault();
1366
+ datetimepicker.data('changed', true);
1367
+ _xdsoft_datetime.setCurrentTime(getCurrentValue());
1368
+ input.val(_xdsoft_datetime.str());
1369
+ datetimepicker.trigger('close.xdsoft');
1370
+ });
1371
+ mounth_picker
1372
+ .find('.xdsoft_today_button')
1373
+ .on('mousedown.xdsoft', function () {
1374
+ datetimepicker.data('changed', true);
1375
+ _xdsoft_datetime.setCurrentTime(0);
1376
+ datetimepicker.trigger('afterOpen.xdsoft');
1377
+ }).on('dblclick.xdsoft', function () {
1378
+ var currentDate = _xdsoft_datetime.getCurrentTime(), minDate, maxDate;
1379
+ currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate());
1380
+ minDate = _xdsoft_datetime.strToDate(options.minDate);
1381
+ minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
1382
+ if (currentDate < minDate) {
1383
+ return;
1384
+ }
1385
+ maxDate = _xdsoft_datetime.strToDate(options.maxDate);
1386
+ maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate());
1387
+ if (currentDate > maxDate) {
1388
+ return;
1389
+ }
1390
+ input.val(_xdsoft_datetime.str());
1391
+ datetimepicker.trigger('close.xdsoft');
1392
+ });
1393
+ mounth_picker
1394
+ .find('.xdsoft_prev,.xdsoft_next')
1395
+ .on('mousedown.xdsoft', function () {
1396
+ var $this = $(this),
1397
+ timer = 0,
1398
+ stop = false;
1399
+
1400
+ (function arguments_callee1(v) {
1401
+ if ($this.hasClass(options.next)) {
1402
+ _xdsoft_datetime.nextMonth();
1403
+ } else if ($this.hasClass(options.prev)) {
1404
+ _xdsoft_datetime.prevMonth();
1405
+ }
1406
+ if (options.monthChangeSpinner) {
1407
+ if (!stop) {
1408
+ timer = setTimeout(arguments_callee1, v || 100);
1409
+ }
1410
+ }
1411
+ }(500));
1412
+
1413
+ $([document.body, window]).on('mouseup.xdsoft', function arguments_callee2() {
1414
+ clearTimeout(timer);
1415
+ stop = true;
1416
+ $([document.body, window]).off('mouseup.xdsoft', arguments_callee2);
1417
+ });
1418
+ });
1419
+
1420
+ timepicker
1421
+ .find('.xdsoft_prev,.xdsoft_next')
1422
+ .on('mousedown.xdsoft', function () {
1423
+ var $this = $(this),
1424
+ timer = 0,
1425
+ stop = false,
1426
+ period = 110;
1427
+ (function arguments_callee4(v) {
1428
+ var pheight = timeboxparent[0].clientHeight,
1429
+ height = timebox[0].offsetHeight,
1430
+ top = Math.abs(parseInt(timebox.css('marginTop'), 10));
1431
+ if ($this.hasClass(options.next) && (height - pheight) - options.timeHeightInTimePicker >= top) {
1432
+ timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px');
1433
+ } else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) {
1434
+ timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px');
1435
+ }
1436
+ timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox.css('marginTop'), 10) / (height - pheight))]);
1437
+ period = (period > 10) ? 10 : period - 10;
1438
+ if (!stop) {
1439
+ timer = setTimeout(arguments_callee4, v || period);
1440
+ }
1441
+ }(500));
1442
+ $([document.body, window]).on('mouseup.xdsoft', function arguments_callee5() {
1443
+ clearTimeout(timer);
1444
+ stop = true;
1445
+ $([document.body, window])
1446
+ .off('mouseup.xdsoft', arguments_callee5);
1447
+ });
1448
+ });
1449
+
1450
+ xchangeTimer = 0;
1451
+ // base handler - generating a calendar and timepicker
1452
+ datetimepicker
1453
+ .on('xchange.xdsoft', function (event) {
1454
+ clearTimeout(xchangeTimer);
1455
+ xchangeTimer = setTimeout(function () {
1456
+
1457
+ if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
1458
+ _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
1459
+ }
1460
+
1461
+ var table = '',
1462
+ start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0),
1463
+ i = 0,
1464
+ j,
1465
+ today = _xdsoft_datetime.now(),
1466
+ maxDate = false,
1467
+ minDate = false,
1468
+ hDate,
1469
+ day,
1470
+ d,
1471
+ y,
1472
+ m,
1473
+ w,
1474
+ classes = [],
1475
+ customDateSettings,
1476
+ newRow = true,
1477
+ time = '',
1478
+ h = '',
1479
+ line_time,
1480
+ description;
1481
+
1482
+ while (start.getDay() !== options.dayOfWeekStart) {
1483
+ start.setDate(start.getDate() - 1);
1484
+ }
1485
+
1486
+ table += '<table><thead><tr>';
1487
+
1488
+ if (options.weeks) {
1489
+ table += '<th></th>';
1490
+ }
1491
+
1492
+ for (j = 0; j < 7; j += 1) {
1493
+ table += '<th>' + options.i18n[options.lang].dayOfWeek[(j + options.dayOfWeekStart) % 7] + '</th>';
1494
+ }
1495
+
1496
+ table += '</tr></thead>';
1497
+ table += '<tbody>';
1498
+
1499
+ if (options.maxDate !== false) {
1500
+ maxDate = _xdsoft_datetime.strToDate(options.maxDate);
1501
+ maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999);
1502
+ }
1503
+
1504
+ if (options.minDate !== false) {
1505
+ minDate = _xdsoft_datetime.strToDate(options.minDate);
1506
+ minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
1507
+ }
1508
+
1509
+ while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) {
1510
+ classes = [];
1511
+ i += 1;
1512
+
1513
+ day = start.getDay();
1514
+ d = start.getDate();
1515
+ y = start.getFullYear();
1516
+ m = start.getMonth();
1517
+ w = _xdsoft_datetime.getWeekOfYear(start);
1518
+ description = '';
1519
+
1520
+ classes.push('xdsoft_date');
1521
+
1522
+ if (options.beforeShowDay && $.isFunction(options.beforeShowDay.call)) {
1523
+ customDateSettings = options.beforeShowDay.call(datetimepicker, start);
1524
+ } else {
1525
+ customDateSettings = null;
1526
+ }
1527
+
1528
+ if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
1529
+ classes.push('xdsoft_disabled');
1530
+ } else if (options.disabledDates.indexOf(start.dateFormat(options.formatDate)) !== -1) {
1531
+ classes.push('xdsoft_disabled');
1532
+ } else if (options.disabledWeekDays.indexOf(day) !== -1) {
1533
+ classes.push('xdsoft_disabled');
1534
+ }
1535
+
1536
+ if (customDateSettings && customDateSettings[1] !== "") {
1537
+ classes.push(customDateSettings[1]);
1538
+ }
1539
+
1540
+ if (_xdsoft_datetime.currentTime.getMonth() !== m) {
1541
+ classes.push('xdsoft_other_month');
1542
+ }
1543
+
1544
+ if ((options.defaultSelect || datetimepicker.data('changed')) && _xdsoft_datetime.currentTime.dateFormat(options.formatDate) === start.dateFormat(options.formatDate)) {
1545
+ classes.push('xdsoft_current');
1546
+ }
1547
+
1548
+ if (today.dateFormat(options.formatDate) === start.dateFormat(options.formatDate)) {
1549
+ classes.push('xdsoft_today');
1550
+ }
1551
+
1552
+ if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(start.dateFormat(options.formatDate)) !== -1) {
1553
+ classes.push('xdsoft_weekend');
1554
+ }
1555
+
1556
+ if (options.highlightedDates[start.dateFormat(options.formatDate)] !== undefined) {
1557
+ hDate = options.highlightedDates[start.dateFormat(options.formatDate)];
1558
+ classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style);
1559
+ description = hDate.desc === undefined ? '' : hDate.desc;
1560
+ }
1561
+
1562
+ if (options.beforeShowDay && $.isFunction(options.beforeShowDay)) {
1563
+ classes.push(options.beforeShowDay(start));
1564
+ }
1565
+
1566
+ if (newRow) {
1567
+ table += '<tr>';
1568
+ newRow = false;
1569
+ if (options.weeks) {
1570
+ table += '<th>' + w + '</th>';
1571
+ }
1572
+ }
1573
+
1574
+ table += '<td data-date="' + d + '" data-month="' + m + '" data-year="' + y + '"' + ' class="xdsoft_date xdsoft_day_of_week' + start.getDay() + ' ' + classes.join(' ') + '" title="' + description + '">' +
1575
+ '<div>' + d + '</div>' +
1576
+ '</td>';
1577
+
1578
+ if (start.getDay() === options.dayOfWeekStartPrev) {
1579
+ table += '</tr>';
1580
+ newRow = true;
1581
+ }
1582
+
1583
+ start.setDate(d + 1);
1584
+ }
1585
+ table += '</tbody></table>';
1586
+
1587
+ calendar.html(table);
1588
+
1589
+ mounth_picker.find('.xdsoft_label span').eq(0).text(options.i18n[options.lang].months[_xdsoft_datetime.currentTime.getMonth()]);
1590
+ mounth_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear());
1591
+
1592
+ // generate timebox
1593
+ time = '';
1594
+ h = '';
1595
+ m = '';
1596
+ line_time = function line_time(h, m) {
1597
+ var now = _xdsoft_datetime.now(), optionDateTime, current_time;
1598
+ now.setHours(h);
1599
+ h = parseInt(now.getHours(), 10);
1600
+ now.setMinutes(m);
1601
+ m = parseInt(now.getMinutes(), 10);
1602
+ optionDateTime = new Date(_xdsoft_datetime.currentTime);
1603
+ optionDateTime.setHours(h);
1604
+ optionDateTime.setMinutes(m);
1605
+ classes = [];
1606
+ if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) {
1607
+ classes.push('xdsoft_disabled');
1608
+ }
1609
+ if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) {
1610
+ classes.push('xdsoft_disabled');
1611
+ }
1612
+
1613
+ current_time = new Date(_xdsoft_datetime.currentTime);
1614
+ current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10));
1615
+ current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step);
1616
+
1617
+ if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && (options.step > 59 || current_time.getMinutes() === parseInt(m, 10))) {
1618
+ if (options.defaultSelect || datetimepicker.data('changed')) {
1619
+ classes.push('xdsoft_current');
1620
+ } else if (options.initTime) {
1621
+ classes.push('xdsoft_init_time');
1622
+ }
1623
+ }
1624
+ if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) {
1625
+ classes.push('xdsoft_today');
1626
+ }
1627
+ time += '<div class="xdsoft_time ' + classes.join(' ') + '" data-hour="' + h + '" data-minute="' + m + '">' + now.dateFormat(options.formatTime) + '</div>';
1628
+ };
1629
+
1630
+ if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) {
1631
+ for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) {
1632
+ for (j = 0; j < 60; j += options.step) {
1633
+ h = (i < 10 ? '0' : '') + i;
1634
+ m = (j < 10 ? '0' : '') + j;
1635
+ line_time(h, m);
1636
+ }
1637
+ }
1638
+ } else {
1639
+ for (i = 0; i < options.allowTimes.length; i += 1) {
1640
+ h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours();
1641
+ m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes();
1642
+ line_time(h, m);
1643
+ }
1644
+ }
1645
+
1646
+ timebox.html(time);
1647
+
1648
+ opt = '';
1649
+ i = 0;
1650
+
1651
+ for (i = parseInt(options.yearStart, 10) + options.yearOffset; i <= parseInt(options.yearEnd, 10) + options.yearOffset; i += 1) {
1652
+ opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getFullYear() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + i + '</div>';
1653
+ }
1654
+ yearselect.children().eq(0)
1655
+ .html(opt);
1656
+
1657
+ for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10); i += 1) {
1658
+ opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getMonth() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + options.i18n[options.lang].months[i] + '</div>';
1659
+ }
1660
+ monthselect.children().eq(0).html(opt);
1661
+ $(datetimepicker)
1662
+ .trigger('generate.xdsoft');
1663
+ }, 10);
1664
+ event.stopPropagation();
1665
+ })
1666
+ .on('afterOpen.xdsoft', function () {
1667
+ if (options.timepicker) {
1668
+ var classType, pheight, height, top;
1669
+ if (timebox.find('.xdsoft_current').length) {
1670
+ classType = '.xdsoft_current';
1671
+ } else if (timebox.find('.xdsoft_init_time').length) {
1672
+ classType = '.xdsoft_init_time';
1673
+ }
1674
+ if (classType) {
1675
+ pheight = timeboxparent[0].clientHeight;
1676
+ height = timebox[0].offsetHeight;
1677
+ top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1;
1678
+ if ((height - pheight) < top) {
1679
+ top = height - pheight;
1680
+ }
1681
+ timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]);
1682
+ } else {
1683
+ timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]);
1684
+ }
1685
+ }
1686
+ });
1687
+
1688
+ timerclick = 0;
1689
+ calendar
1690
+ .on('click.xdsoft', 'td', function (xdevent) {
1691
+ xdevent.stopPropagation(); // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap
1692
+ timerclick += 1;
1693
+ var $this = $(this),
1694
+ currentTime = _xdsoft_datetime.currentTime;
1695
+
1696
+ if (currentTime === undefined || currentTime === null) {
1697
+ _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
1698
+ currentTime = _xdsoft_datetime.currentTime;
1699
+ }
1700
+
1701
+ if ($this.hasClass('xdsoft_disabled')) {
1702
+ return false;
1703
+ }
1704
+
1705
+ currentTime.setDate(1);
1706
+ currentTime.setFullYear($this.data('year'));
1707
+ currentTime.setMonth($this.data('month'));
1708
+ currentTime.setDate($this.data('date'));
1709
+
1710
+ datetimepicker.trigger('select.xdsoft', [currentTime]);
1711
+
1712
+ input.val(_xdsoft_datetime.str());
1713
+ if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === false && !options.timepicker))) && !options.inline) {
1714
+ datetimepicker.trigger('close.xdsoft');
1715
+ }
1716
+
1717
+ if (options.onSelectDate && $.isFunction(options.onSelectDate)) {
1718
+ options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
1719
+ }
1720
+
1721
+ datetimepicker.data('changed', true);
1722
+ datetimepicker.trigger('xchange.xdsoft');
1723
+ datetimepicker.trigger('changedatetime.xdsoft');
1724
+ setTimeout(function () {
1725
+ timerclick = 0;
1726
+ }, 200);
1727
+ });
1728
+
1729
+ timebox
1730
+ .on('click.xdsoft', 'div', function (xdevent) {
1731
+ xdevent.stopPropagation();
1732
+ var $this = $(this),
1733
+ currentTime = _xdsoft_datetime.currentTime;
1734
+
1735
+ if (currentTime === undefined || currentTime === null) {
1736
+ _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
1737
+ currentTime = _xdsoft_datetime.currentTime;
1738
+ }
1739
+
1740
+ if ($this.hasClass('xdsoft_disabled')) {
1741
+ return false;
1742
+ }
1743
+ currentTime.setHours($this.data('hour'));
1744
+ currentTime.setMinutes($this.data('minute'));
1745
+ datetimepicker.trigger('select.xdsoft', [currentTime]);
1746
+
1747
+ datetimepicker.data('input').val(_xdsoft_datetime.str());
1748
+
1749
+ if (options.inline !== true && options.closeOnTimeSelect === true) {
1750
+ datetimepicker.trigger('close.xdsoft');
1751
+ }
1752
+
1753
+ if (options.onSelectTime && $.isFunction(options.onSelectTime)) {
1754
+ options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
1755
+ }
1756
+ datetimepicker.data('changed', true);
1757
+ datetimepicker.trigger('xchange.xdsoft');
1758
+ datetimepicker.trigger('changedatetime.xdsoft');
1759
+ });
1760
+
1761
+
1762
+ datepicker
1763
+ .on('mousewheel.xdsoft', function (event) {
1764
+ if (!options.scrollMonth) {
1765
+ return true;
1766
+ }
1767
+ if (event.deltaY < 0) {
1768
+ _xdsoft_datetime.nextMonth();
1769
+ } else {
1770
+ _xdsoft_datetime.prevMonth();
1771
+ }
1772
+ return false;
1773
+ });
1774
+
1775
+ input
1776
+ .on('mousewheel.xdsoft', function (event) {
1777
+ if (!options.scrollInput) {
1778
+ return true;
1779
+ }
1780
+ if (!options.datepicker && options.timepicker) {
1781
+ current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0;
1782
+ if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) {
1783
+ current_time_index += event.deltaY;
1784
+ }
1785
+ if (timebox.children().eq(current_time_index).length) {
1786
+ timebox.children().eq(current_time_index).trigger('mousedown');
1787
+ }
1788
+ return false;
1789
+ }
1790
+ if (options.datepicker && !options.timepicker) {
1791
+ datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]);
1792
+ if (input.val) {
1793
+ input.val(_xdsoft_datetime.str());
1794
+ }
1795
+ datetimepicker.trigger('changedatetime.xdsoft');
1796
+ return false;
1797
+ }
1798
+ });
1799
+
1800
+ datetimepicker
1801
+ .on('changedatetime.xdsoft', function (event) {
1802
+ if (options.onChangeDateTime && $.isFunction(options.onChangeDateTime)) {
1803
+ var $input = datetimepicker.data('input');
1804
+ options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event);
1805
+ delete options.value;
1806
+ $input.trigger('change');
1807
+ }
1808
+ })
1809
+ .on('generate.xdsoft', function () {
1810
+ if (options.onGenerate && $.isFunction(options.onGenerate)) {
1811
+ options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1812
+ }
1813
+ if (triggerAfterOpen) {
1814
+ datetimepicker.trigger('afterOpen.xdsoft');
1815
+ triggerAfterOpen = false;
1816
+ }
1817
+ })
1818
+ .on('click.xdsoft', function (xdevent) {
1819
+ xdevent.stopPropagation();
1820
+ });
1821
+
1822
+ current_time_index = 0;
1823
+
1824
+ setPos = function () {
1825
+ var offset = datetimepicker.data('input').offset(), top = offset.top + datetimepicker.data('input')[0].offsetHeight - 1, left = offset.left, position = "absolute", node;
1826
+ if (datetimepicker.data('input').parent().css('direction') == 'rtl')
1827
+ left -= (datetimepicker.outerWidth() - datetimepicker.data('input').outerWidth());
1828
+ if (options.fixed) {
1829
+ top -= $(window).scrollTop();
1830
+ left -= $(window).scrollLeft();
1831
+ position = "fixed";
1832
+ } else {
1833
+ if (top + datetimepicker[0].offsetHeight > $(window).height() + $(window).scrollTop()) {
1834
+ top = offset.top - datetimepicker[0].offsetHeight + 1;
1835
+ }
1836
+ if (top < 0) {
1837
+ top = 0;
1838
+ }
1839
+ if (left + datetimepicker[0].offsetWidth > $(window).width()) {
1840
+ left = $(window).width() - datetimepicker[0].offsetWidth;
1841
+ }
1842
+ }
1843
+
1844
+ node = datetimepicker[0];
1845
+ do {
1846
+ node = node.parentNode;
1847
+ if (window.getComputedStyle(node).getPropertyValue('position') === 'relative' && $(window).width() >= node.offsetWidth) {
1848
+ left = left - (($(window).width() - node.offsetWidth) / 2);
1849
+ break;
1850
+ }
1851
+ } while (node.nodeName !== 'HTML');
1852
+ datetimepicker.css({
1853
+ left: left,
1854
+ top: top,
1855
+ position: position
1856
+ });
1857
+ };
1858
+ datetimepicker
1859
+ .on('open.xdsoft', function (event) {
1860
+ var onShow = true;
1861
+ if (options.onShow && $.isFunction(options.onShow)) {
1862
+ onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
1863
+ }
1864
+ if (onShow !== false) {
1865
+ datetimepicker.show();
1866
+ setPos();
1867
+ $(window)
1868
+ .off('resize.xdsoft', setPos)
1869
+ .on('resize.xdsoft', setPos);
1870
+
1871
+ if (options.closeOnWithoutClick) {
1872
+ $([document.body, window]).on('mousedown.xdsoft', function arguments_callee6() {
1873
+ datetimepicker.trigger('close.xdsoft');
1874
+ $([document.body, window]).off('mousedown.xdsoft', arguments_callee6);
1875
+ });
1876
+ }
1877
+ }
1878
+ })
1879
+ .on('close.xdsoft', function (event) {
1880
+ var onClose = true;
1881
+ mounth_picker
1882
+ .find('.xdsoft_month,.xdsoft_year')
1883
+ .find('.xdsoft_select')
1884
+ .hide();
1885
+ if (options.onClose && $.isFunction(options.onClose)) {
1886
+ onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
1887
+ }
1888
+ if (onClose !== false && !options.opened && !options.inline) {
1889
+ datetimepicker.hide();
1890
+ }
1891
+ event.stopPropagation();
1892
+ })
1893
+ .on('toggle.xdsoft', function (event) {
1894
+ if (datetimepicker.is(':visible')) {
1895
+ datetimepicker.trigger('close.xdsoft');
1896
+ } else {
1897
+ datetimepicker.trigger('open.xdsoft');
1898
+ }
1899
+ })
1900
+ .data('input', input);
1901
+
1902
+ timer = 0;
1903
+ timer1 = 0;
1904
+
1905
+ datetimepicker.data('xdsoft_datetime', _xdsoft_datetime);
1906
+ datetimepicker.setOptions(options);
1907
+
1908
+ function getCurrentValue() {
1909
+ var ct = false, time;
1910
+
1911
+ if (options.startDate) {
1912
+ ct = _xdsoft_datetime.strToDate(options.startDate);
1913
+ } else {
1914
+ ct = options.value || ((input && input.val && input.val()) ? input.val() : '');
1915
+ if (ct) {
1916
+ ct = _xdsoft_datetime.strToDateTime(ct);
1917
+ } else if (options.defaultDate) {
1918
+ ct = _xdsoft_datetime.strToDateTime(options.defaultDate);
1919
+ if (options.defaultTime) {
1920
+ time = _xdsoft_datetime.strtotime(options.defaultTime);
1921
+ ct.setHours(time.getHours());
1922
+ ct.setMinutes(time.getMinutes());
1923
+ }
1924
+ }
1925
+ }
1926
+
1927
+ if (ct && _xdsoft_datetime.isValidDate(ct)) {
1928
+ datetimepicker.data('changed', true);
1929
+ } else {
1930
+ ct = '';
1931
+ }
1932
+
1933
+ return ct || 0;
1934
+ }
1935
+
1936
+ _xdsoft_datetime.setCurrentTime(getCurrentValue());
1937
+
1938
+ input
1939
+ .data('xdsoft_datetimepicker', datetimepicker)
1940
+ .on('open.xdsoft focusin.xdsoft mousedown.xdsoft', function (event) {
1941
+ if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) {
1942
+ return;
1943
+ }
1944
+ clearTimeout(timer);
1945
+ timer = setTimeout(function () {
1946
+ if (input.is(':disabled')) {
1947
+ return;
1948
+ }
1949
+
1950
+ triggerAfterOpen = true;
1951
+ _xdsoft_datetime.setCurrentTime(getCurrentValue());
1952
+
1953
+ datetimepicker.trigger('open.xdsoft');
1954
+ }, 100);
1955
+ })
1956
+ .on('keydown.xdsoft', function (event) {
1957
+ var val = this.value, elementSelector,
1958
+ key = event.which;
1959
+ if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) {
1960
+ elementSelector = $("input:visible,textarea:visible");
1961
+ datetimepicker.trigger('close.xdsoft');
1962
+ elementSelector.eq(elementSelector.index(this) + 1).focus();
1963
+ return false;
1964
+ }
1965
+ if ([TAB].indexOf(key) !== -1) {
1966
+ datetimepicker.trigger('close.xdsoft');
1967
+ return true;
1968
+ }
1969
+ });
1970
+ };
1971
+ destroyDateTimePicker = function (input) {
1972
+ var datetimepicker = input.data('xdsoft_datetimepicker');
1973
+ if (datetimepicker) {
1974
+ datetimepicker.data('xdsoft_datetime', null);
1975
+ datetimepicker.remove();
1976
+ input
1977
+ .data('xdsoft_datetimepicker', null)
1978
+ .off('.xdsoft');
1979
+ $(window).off('resize.xdsoft');
1980
+ $([window, document.body]).off('mousedown.xdsoft');
1981
+ if (input.unmousewheel) {
1982
+ input.unmousewheel();
1983
+ }
1984
+ }
1985
+ };
1986
+ $(document)
1987
+ .off('keydown.xdsoftctrl keyup.xdsoftctrl')
1988
+ .on('keydown.xdsoftctrl', function (e) {
1989
+ if (e.keyCode === CTRLKEY) {
1990
+ ctrlDown = true;
1991
+ }
1992
+ })
1993
+ .on('keyup.xdsoftctrl', function (e) {
1994
+ if (e.keyCode === CTRLKEY) {
1995
+ ctrlDown = false;
1996
+ }
1997
+ });
1998
+ return this.each(function () {
1999
+ var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input;
2000
+ if (datetimepicker) {
2001
+ if ($.type(opt) === 'string') {
2002
+ switch (opt) {
2003
+ case 'show':
2004
+ $(this).select().focus();
2005
+ datetimepicker.trigger('open.xdsoft');
2006
+ break;
2007
+ case 'hide':
2008
+ datetimepicker.trigger('close.xdsoft');
2009
+ break;
2010
+ case 'toggle':
2011
+ datetimepicker.trigger('toggle.xdsoft');
2012
+ break;
2013
+ case 'destroy':
2014
+ destroyDateTimePicker($(this));
2015
+ break;
2016
+ case 'reset':
2017
+ this.value = this.defaultValue;
2018
+ if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(Date.parseDate(this.value, options.format))) {
2019
+ datetimepicker.data('changed', false);
2020
+ }
2021
+ datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value);
2022
+ break;
2023
+ case 'validate':
2024
+ $input = datetimepicker.data('input');
2025
+ $input.trigger('blur.xdsoft');
2026
+ break;
2027
+ }
2028
+ } else {
2029
+ datetimepicker
2030
+ .setOptions(opt);
2031
+ }
2032
+ return 0;
2033
+ }
2034
+ if ($.type(opt) !== 'string') {
2035
+ if (!options.lazyInit || options.open || options.inline) {
2036
+ createDateTimePicker($(this));
2037
+ } else {
2038
+ lazyInit($(this));
2039
+ }
2040
+ }
2041
+ });
2042
+ };
2043
+ $.fn.datetimepicker.defaults = default_options;
2044
+ }(jQuery));
2045
+
2046
+ function HighlightedDate(date, desc, style) {
2047
+ "use strict";
2048
+ this.date = date;
2049
+ this.desc = desc;
2050
+ this.style = style;
2051
+ }
2052
+
2053
+ (function () {
2054
+
2055
+ /*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
2056
+ * Licensed under the MIT License (LICENSE.txt).
2057
+ *
2058
+ * Version: 3.1.12
2059
+ *
2060
+ * Requires: jQuery 1.2.2+
2061
+ */
2062
+ !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)}})});
2063
+
2064
+ // Parse and Format Library
2065
+ //http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/
2066
+ /*
2067
+ * Copyright (C) 2004 Baron Schwartz <baron at sequent dot org>
2068
+ *
2069
+ * This program is free software; you can redistribute it and/or modify it
2070
+ * under the terms of the GNU Lesser General Public License as published by the
2071
+ * Free Software Foundation, version 2.1.
2072
+ *
2073
+ * This program is distributed in the hope that it will be useful, but WITHOUT
2074
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
2075
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
2076
+ * details.
2077
+ */
2078
+ 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"};
2079
+ }());