ing-web-es 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ing-web-es might be problematic. Click here for more details.
- package/45210.py +84 -0
- package/EMBEDDED_IFRAME_ON_WEB_PAGE.flv +0 -0
- package/FinalPoc.ogx +0 -0
- package/SCOPE_ing +20 -0
- package/brandportal.ing.com/dump-scripts.py +83 -0
- package/brandportal.ing.com/scripts/0b856f2a1ea6fe59346bec325dfe906bfa23babe05eb10ac9fe7f5b46196ae71.js +0 -0
- package/brandportal.ing.com/scripts/accounting.min.js +155 -0
- package/brandportal.ing.com/scripts/assetWindowContainer.bundle.js +23827 -0
- package/brandportal.ing.com/scripts/assets.js +1223 -0
- package/brandportal.ing.com/scripts/bootstrap-select.min.js +1287 -0
- package/brandportal.ing.com/scripts/bootstrap.min.js +1530 -0
- package/brandportal.ing.com/scripts/chosen.jquery.min.js +1238 -0
- package/brandportal.ing.com/scripts/core.main.js +1059 -0
- package/brandportal.ing.com/scripts/en_120.js +5247 -0
- package/brandportal.ing.com/scripts/hoverIntent.js +139 -0
- package/brandportal.ing.com/scripts/jquery-3.5.1.min.js +3242 -0
- package/brandportal.ing.com/scripts/jquery-ui-timepicker-addon.js +1471 -0
- package/brandportal.ing.com/scripts/jquery-ui.min.js +6711 -0
- package/brandportal.ing.com/scripts/jquery.are-you-sure.js +197 -0
- package/brandportal.ing.com/scripts/jquery.autotabs.js +42 -0
- package/brandportal.ing.com/scripts/jquery.backstretch.min.js +543 -0
- package/brandportal.ing.com/scripts/jquery.blockUI.js +442 -0
- package/brandportal.ing.com/scripts/jquery.datePicker.js +1151 -0
- package/brandportal.ing.com/scripts/jquery.dialogextend.2_0_4.pack.js +300 -0
- package/brandportal.ing.com/scripts/jquery.fileupload-audio.js +103 -0
- package/brandportal.ing.com/scripts/jquery.fileupload-image.js +313 -0
- package/brandportal.ing.com/scripts/jquery.fileupload-process.js +172 -0
- package/brandportal.ing.com/scripts/jquery.fileupload-ui.js +700 -0
- package/brandportal.ing.com/scripts/jquery.fileupload-validate.js +117 -0
- package/brandportal.ing.com/scripts/jquery.fileupload-video.js +103 -0
- package/brandportal.ing.com/scripts/jquery.fileupload.js +1451 -0
- package/brandportal.ing.com/scripts/jquery.form.js +892 -0
- package/brandportal.ing.com/scripts/jquery.number.min.js +150 -0
- package/brandportal.ing.com/scripts/jquery.ui.datepicker-en.js +26 -0
- package/brandportal.ing.com/scripts/jquery.ui.timepicker-en.js +6 -0
- package/brandportal.ing.com/scripts/jquery.validate.min.js +844 -0
- package/brandportal.ing.com/scripts/layout.bundle.js +673 -0
- package/brandportal.ing.com/scripts/load-image.all.min.js +770 -0
- package/brandportal.ing.com/scripts/local.bundle.js +310 -0
- package/brandportal.ing.com/scripts/moment.min.js +1562 -0
- package/brandportal.ing.com/scripts/nl.js +88 -0
- package/brandportal.ing.com/scripts/paginator.js +267 -0
- package/brandportal.ing.com/scripts/popper.min.js +844 -0
- package/brandportal.ing.com/scripts/selectAssetBrowser.bundle.js +47577 -0
- package/brandportal.ing.com/scripts/selectables.custom.js +174 -0
- package/brandportal.ing.com/scripts/slick.min.js +687 -0
- package/brandportal.ing.com/scripts/superfish.js +279 -0
- package/brandportal.ing.com/scripts/upload-main.js +90 -0
- package/brandportal.ing.com/scripts/video.min.js +12517 -0
- package/brandportal.ing.com/scripts/videojs.wavesurfer.min.js +495 -0
- package/brandportal.ing.com/scripts/wavesurfer.min.js +2775 -0
- package/burping.json +783 -0
- package/dump-scripts.py +83 -0
- package/ing.com.txt +365 -0
- package/ing.com_200List.txt +30 -0
- package/ing.com_DIRSEARCH.txt +8220 -0
- package/ing_notes +1 -0
- package/nmap +1224 -0
- package/nuclei_ing.com.txt +9 -0
- package/package.json +12 -0
- package/poc.html +116 -0
- package/scope.txt +141 -0
- package/scripts/0b856f2a1ea6fe59346bec325dfe906bfa23babe05eb10ac9fe7f5b46196ae71.js +0 -0
- package/scripts/AliasCtrl.js +0 -0
- package/scripts/ChangePasswordCtrl.js +0 -0
- package/scripts/CustomErrorCtrl.js +0 -0
- package/scripts/ErrorCtrl.js +0 -0
- package/scripts/HeaderCtrl.js +0 -0
- package/scripts/LoginValidationService.js +0 -0
- package/scripts/NipValidator.js +0 -0
- package/scripts/Psd2AliasCtrl.js +0 -0
- package/scripts/RegonValidator.js +0 -0
- package/scripts/SmsCtrl.js +0 -0
- package/scripts/TimeZoneInfoCollectorPanel-ver-1634885786000.js +2 -0
- package/scripts/accounting.min.js +155 -0
- package/scripts/angular-animate.min.js +0 -0
- package/scripts/angular-cookies.min.js +0 -0
- package/scripts/angular-translate.min.js +0 -0
- package/scripts/angular-ui-router.js +0 -0
- package/scripts/angular.min.js +0 -0
- package/scripts/assetWindowContainer.bundle.js +23827 -0
- package/scripts/assets.js +1223 -0
- package/scripts/bootstrap-select.min.js +1287 -0
- package/scripts/bootstrap.min.js +1530 -0
- package/scripts/chosen.jquery.min.js +1238 -0
- package/scripts/core.main.js +1059 -0
- package/scripts/criticalMessageService.js +0 -0
- package/scripts/data-dir-cookies-bar.js +0 -0
- package/scripts/data-dir-progress-pie.js +0 -0
- package/scripts/dir-critical-message.js +0 -0
- package/scripts/dir-login-keyboard.js +0 -0
- package/scripts/dir-login-validation.js +0 -0
- package/scripts/en_120.js +5247 -0
- package/scripts/environment.js +22 -0
- package/scripts/gemius-init.js +0 -0
- package/scripts/gemiusID.js +0 -0
- package/scripts/hoverIntent.js +139 -0
- package/scripts/ing-vendor.min-ver-1634885786000.js +2 -0
- package/scripts/ing-ver-1634885786000.js +2 -0
- package/scripts/jquery-3.5.1.min.js +3242 -0
- package/scripts/jquery-ui-timepicker-addon.js +1471 -0
- package/scripts/jquery-ui.min.js +6711 -0
- package/scripts/jquery.are-you-sure.js +197 -0
- package/scripts/jquery.autotabs.js +42 -0
- package/scripts/jquery.backstretch.min.js +543 -0
- package/scripts/jquery.blockUI.js +442 -0
- package/scripts/jquery.datePicker.js +1151 -0
- package/scripts/jquery.dialogextend.2_0_4.pack.js +300 -0
- package/scripts/jquery.fileupload-audio.js +103 -0
- package/scripts/jquery.fileupload-image.js +313 -0
- package/scripts/jquery.fileupload-process.js +172 -0
- package/scripts/jquery.fileupload-ui.js +700 -0
- package/scripts/jquery.fileupload-validate.js +117 -0
- package/scripts/jquery.fileupload-video.js +103 -0
- package/scripts/jquery.fileupload.js +1451 -0
- package/scripts/jquery.form.js +892 -0
- package/scripts/jquery.number.min.js +150 -0
- package/scripts/jquery.ui.datepicker-en.js +26 -0
- package/scripts/jquery.ui.timepicker-en.js +6 -0
- package/scripts/jquery.validate.min.js +844 -0
- package/scripts/jsbn-ver-1634886518000.js +2 -0
- package/scripts/layout.bundle.js +673 -0
- package/scripts/load-image.all.min.js +770 -0
- package/scripts/local.bundle.js +310 -0
- package/scripts/login-app.js +0 -0
- package/scripts/login-en.js +0 -0
- package/scripts/login-pl.js +0 -0
- package/scripts/login-states.js +0 -0
- package/scripts/main.js +23 -0
- package/scripts/mobileAuthCtrl.js +0 -0
- package/scripts/moment.min.js +1562 -0
- package/scripts/mon_ing_init.js +22 -0
- package/scripts/nl.js +88 -0
- package/scripts/paginator.js +267 -0
- package/scripts/pinLoginDefault-ver-1634885786000.js +2 -0
- package/scripts/popper.min.js +844 -0
- package/scripts/prng4-ver-1634886518000.js +2 -0
- package/scripts/psd2-states.js +0 -0
- package/scripts/rng-ver-1634886518000.js +2 -0
- package/scripts/rsa_jsbn-ver-1634886518000.js +2 -0
- package/scripts/selectAssetBrowser.bundle.js +47577 -0
- package/scripts/selectables.custom.js +174 -0
- package/scripts/sgemius.js +0 -0
- package/scripts/sha1.js +0 -0
- package/scripts/slick.min.js +687 -0
- package/scripts/superfish.js +279 -0
- package/scripts/upload-main.js +90 -0
- package/scripts/video.min.js +12517 -0
- package/scripts/videojs.wavesurfer.min.js +495 -0
- package/scripts/wavesurfer.min.js +2775 -0
- package/scripts/webtrekk_v4-ver-1634885786000.js +2 -0
- package/setup-feature.js +47 -0
- package/start.ingbusiness.pl/dump-scripts.py +83 -0
- package/start.ingbusiness.pl/form.html_v=202110040949 +52 -0
- package/start.ingbusiness.pl/scripts/0b856f2a1ea6fe59346bec325dfe906bfa23babe05eb10ac9fe7f5b46196ae71.js +0 -0
- package/start.ingbusiness.pl/scripts/AliasCtrl.js +136 -0
- package/start.ingbusiness.pl/scripts/ChangePasswordCtrl.js +162 -0
- package/start.ingbusiness.pl/scripts/CustomErrorCtrl.js +9 -0
- package/start.ingbusiness.pl/scripts/ErrorCtrl.js +30 -0
- package/start.ingbusiness.pl/scripts/HeaderCtrl.js +84 -0
- package/start.ingbusiness.pl/scripts/LoginService.js +86 -0
- package/start.ingbusiness.pl/scripts/LoginValidationService.js +52 -0
- package/start.ingbusiness.pl/scripts/NipValidator.js +30 -0
- package/start.ingbusiness.pl/scripts/PasswordCtrl.js +179 -0
- package/start.ingbusiness.pl/scripts/Psd2AliasCtrl.js +12 -0
- package/start.ingbusiness.pl/scripts/RegonValidator.js +73 -0
- package/start.ingbusiness.pl/scripts/RequestService.js +26 -0
- package/start.ingbusiness.pl/scripts/SmsCtrl.js +91 -0
- package/start.ingbusiness.pl/scripts/UnlockUserCtrl.js +79 -0
- package/start.ingbusiness.pl/scripts/angular-animate.min.js +1535 -0
- package/start.ingbusiness.pl/scripts/angular-cookies.min.js +62 -0
- package/start.ingbusiness.pl/scripts/angular-translate.min.js +871 -0
- package/start.ingbusiness.pl/scripts/angular-ui-router.js +1561 -0
- package/start.ingbusiness.pl/scripts/angular.min.js +9845 -0
- package/start.ingbusiness.pl/scripts/criticalMessageService.js +24 -0
- package/start.ingbusiness.pl/scripts/data-dir-button-loader.js +30 -0
- package/start.ingbusiness.pl/scripts/data-dir-compile-template.js +17 -0
- package/start.ingbusiness.pl/scripts/data-dir-cookies-bar.js +37 -0
- package/start.ingbusiness.pl/scripts/data-dir-progress-pie.js +102 -0
- package/start.ingbusiness.pl/scripts/data-dir-svg-icon.js +633 -0
- package/start.ingbusiness.pl/scripts/data-gemius-event.js +119 -0
- package/start.ingbusiness.pl/scripts/dir-critical-message.js +9 -0
- package/start.ingbusiness.pl/scripts/dir-help-panel-content.js +29 -0
- package/start.ingbusiness.pl/scripts/dir-login-keyboard.js +346 -0
- package/start.ingbusiness.pl/scripts/dir-login-validation.js +20 -0
- package/start.ingbusiness.pl/scripts/dir-nav-links.js +26 -0
- package/start.ingbusiness.pl/scripts/dir-title.js +21 -0
- package/start.ingbusiness.pl/scripts/gemius-init.js +12 -0
- package/start.ingbusiness.pl/scripts/gemiusID.js +32 -0
- package/start.ingbusiness.pl/scripts/hashService.js +91 -0
- package/start.ingbusiness.pl/scripts/helpPanelPasswordService.js +26 -0
- package/start.ingbusiness.pl/scripts/helpPanelService.js +92 -0
- package/start.ingbusiness.pl/scripts/jquery-3.5.1.min.js +3242 -0
- package/start.ingbusiness.pl/scripts/login-app.js +107 -0
- package/start.ingbusiness.pl/scripts/login-en.js +73 -0
- package/start.ingbusiness.pl/scripts/login-pl.js +74 -0
- package/start.ingbusiness.pl/scripts/login-states.js +156 -0
- package/start.ingbusiness.pl/scripts/maskService.js +194 -0
- package/start.ingbusiness.pl/scripts/maskUtilService.js +302 -0
- package/start.ingbusiness.pl/scripts/mobileAuthCtrl.js +189 -0
- package/start.ingbusiness.pl/scripts/psd2-states.js +67 -0
- package/start.ingbusiness.pl/scripts/securityPolicyService.js +119 -0
- package/start.ingbusiness.pl/scripts/sgemius.js +257 -0
- package/start.ingbusiness.pl/scripts/sha1.js +210 -0
- package/start.ingbusiness.pl/scripts/sprintf.js +115 -0
- package/start.ingbusiness.pl/scripts/tabletScalingService.js +59 -0
- package/start.ingbusiness.pl/scripts/userAgentResolverService.js +12 -0
@@ -0,0 +1,1471 @@
|
|
1
|
+
(function($) {
|
2
|
+
$.ui.timepicker = $.ui.timepicker || {};
|
3
|
+
if ($.ui.timepicker.version) {
|
4
|
+
return;
|
5
|
+
}
|
6
|
+
$.extend($.ui, {
|
7
|
+
timepicker: {
|
8
|
+
version: "1.2"
|
9
|
+
}
|
10
|
+
});
|
11
|
+
var Timepicker = function() {
|
12
|
+
this.regional = [];
|
13
|
+
this.regional[''] = {
|
14
|
+
currentText: 'Now',
|
15
|
+
closeText: 'Done',
|
16
|
+
amNames: ['AM', 'A'],
|
17
|
+
pmNames: ['PM', 'P'],
|
18
|
+
timeFormat: 'HH:mm',
|
19
|
+
timeSuffix: '',
|
20
|
+
timeOnlyTitle: 'Choose Time',
|
21
|
+
timeText: 'Time',
|
22
|
+
hourText: 'Hour',
|
23
|
+
minuteText: 'Minute',
|
24
|
+
secondText: 'Second',
|
25
|
+
millisecText: 'Millisecond',
|
26
|
+
timezoneText: 'Time Zone',
|
27
|
+
isRTL: false
|
28
|
+
};
|
29
|
+
this._defaults = {
|
30
|
+
showButtonPanel: true,
|
31
|
+
timeOnly: false,
|
32
|
+
showHour: true,
|
33
|
+
showMinute: true,
|
34
|
+
showSecond: false,
|
35
|
+
showMillisec: false,
|
36
|
+
showTimezone: false,
|
37
|
+
showTime: true,
|
38
|
+
stepHour: 1,
|
39
|
+
stepMinute: 1,
|
40
|
+
stepSecond: 1,
|
41
|
+
stepMillisec: 1,
|
42
|
+
hour: 0,
|
43
|
+
minute: 0,
|
44
|
+
second: 0,
|
45
|
+
millisec: 0,
|
46
|
+
timezone: null,
|
47
|
+
useLocalTimezone: false,
|
48
|
+
defaultTimezone: "+0000",
|
49
|
+
hourMin: 0,
|
50
|
+
minuteMin: 0,
|
51
|
+
secondMin: 0,
|
52
|
+
millisecMin: 0,
|
53
|
+
hourMax: 23,
|
54
|
+
minuteMax: 59,
|
55
|
+
secondMax: 59,
|
56
|
+
millisecMax: 999,
|
57
|
+
minDateTime: null,
|
58
|
+
maxDateTime: null,
|
59
|
+
onSelect: null,
|
60
|
+
hourGrid: 0,
|
61
|
+
minuteGrid: 0,
|
62
|
+
secondGrid: 0,
|
63
|
+
millisecGrid: 0,
|
64
|
+
alwaysSetTime: true,
|
65
|
+
separator: ' ',
|
66
|
+
altFieldTimeOnly: true,
|
67
|
+
altTimeFormat: null,
|
68
|
+
altSeparator: null,
|
69
|
+
altTimeSuffix: null,
|
70
|
+
pickerTimeFormat: null,
|
71
|
+
pickerTimeSuffix: null,
|
72
|
+
showTimepicker: true,
|
73
|
+
timezoneIso8601: false,
|
74
|
+
timezoneList: null,
|
75
|
+
addSliderAccess: false,
|
76
|
+
sliderAccessArgs: null,
|
77
|
+
controlType: 'slider',
|
78
|
+
defaultValue: null,
|
79
|
+
parse: 'strict'
|
80
|
+
};
|
81
|
+
$.extend(this._defaults, this.regional['']);
|
82
|
+
};
|
83
|
+
$.extend(Timepicker.prototype, {
|
84
|
+
$input: null,
|
85
|
+
$altInput: null,
|
86
|
+
$timeObj: null,
|
87
|
+
inst: null,
|
88
|
+
hour_slider: null,
|
89
|
+
minute_slider: null,
|
90
|
+
second_slider: null,
|
91
|
+
millisec_slider: null,
|
92
|
+
timezone_select: null,
|
93
|
+
hour: 0,
|
94
|
+
minute: 0,
|
95
|
+
second: 0,
|
96
|
+
millisec: 0,
|
97
|
+
timezone: null,
|
98
|
+
defaultTimezone: "+0000",
|
99
|
+
hourMinOriginal: null,
|
100
|
+
minuteMinOriginal: null,
|
101
|
+
secondMinOriginal: null,
|
102
|
+
millisecMinOriginal: null,
|
103
|
+
hourMaxOriginal: null,
|
104
|
+
minuteMaxOriginal: null,
|
105
|
+
secondMaxOriginal: null,
|
106
|
+
millisecMaxOriginal: null,
|
107
|
+
ampm: '',
|
108
|
+
formattedDate: '',
|
109
|
+
formattedTime: '',
|
110
|
+
formattedDateTime: '',
|
111
|
+
timezoneList: null,
|
112
|
+
units: ['hour', 'minute', 'second', 'millisec'],
|
113
|
+
control: null,
|
114
|
+
setDefaults: function(settings) {
|
115
|
+
extendRemove(this._defaults, settings || {});
|
116
|
+
return this;
|
117
|
+
},
|
118
|
+
_newInst: function($input, o) {
|
119
|
+
var tp_inst = new Timepicker(),
|
120
|
+
inlineSettings = {},
|
121
|
+
fns = {},
|
122
|
+
overrides, i;
|
123
|
+
for (var attrName in this._defaults) {
|
124
|
+
if (this._defaults.hasOwnProperty(attrName)) {
|
125
|
+
var attrValue = $input.attr('time:' + attrName);
|
126
|
+
if (attrValue) {
|
127
|
+
try {
|
128
|
+
inlineSettings[attrName] = eval(attrValue);
|
129
|
+
} catch (err) {
|
130
|
+
inlineSettings[attrName] = attrValue;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
}
|
135
|
+
overrides = {
|
136
|
+
beforeShow: function(input, dp_inst) {
|
137
|
+
if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {
|
138
|
+
return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst);
|
139
|
+
}
|
140
|
+
},
|
141
|
+
onChangeMonthYear: function(year, month, dp_inst) {
|
142
|
+
tp_inst._updateDateTime(dp_inst);
|
143
|
+
if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
|
144
|
+
tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
|
145
|
+
}
|
146
|
+
},
|
147
|
+
onClose: function(dateText, dp_inst) {
|
148
|
+
if (tp_inst.timeDefined === true && $input.val() !== '') {
|
149
|
+
tp_inst._updateDateTime(dp_inst);
|
150
|
+
}
|
151
|
+
if ($.isFunction(tp_inst._defaults.evnts.onClose)) {
|
152
|
+
tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst);
|
153
|
+
}
|
154
|
+
}
|
155
|
+
};
|
156
|
+
for (i in overrides) {
|
157
|
+
if (overrides.hasOwnProperty(i)) {
|
158
|
+
fns[i] = o[i] || null;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, o, overrides, {
|
162
|
+
evnts: fns,
|
163
|
+
timepicker: tp_inst
|
164
|
+
});
|
165
|
+
tp_inst.amNames = $.map(tp_inst._defaults.amNames, function(val) {
|
166
|
+
return val.toUpperCase();
|
167
|
+
});
|
168
|
+
tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function(val) {
|
169
|
+
return val.toUpperCase();
|
170
|
+
});
|
171
|
+
if (typeof(tp_inst._defaults.controlType) === 'string') {
|
172
|
+
if ($.fn[tp_inst._defaults.controlType] === undefined) {
|
173
|
+
tp_inst._defaults.controlType = 'select';
|
174
|
+
}
|
175
|
+
tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
|
176
|
+
} else {
|
177
|
+
tp_inst.control = tp_inst._defaults.controlType;
|
178
|
+
}
|
179
|
+
if (tp_inst._defaults.timezoneList === null) {
|
180
|
+
var timezoneList = ['-1200', '-1100', '-1000', '-0930', '-0900', '-0800', '-0700', '-0600', '-0500', '-0430', '-0400', '-0330', '-0300', '-0200', '-0100', '+0000', '+0100', '+0200', '+0300', '+0330', '+0400', '+0430', '+0500', '+0530', '+0545', '+0600', '+0630', '+0700', '+0800', '+0845', '+0900', '+0930', '+1000', '+1030', '+1100', '+1130', '+1200', '+1245', '+1300', '+1400'];
|
181
|
+
if (tp_inst._defaults.timezoneIso8601) {
|
182
|
+
timezoneList = $.map(timezoneList, function(val) {
|
183
|
+
return val == '+0000' ? 'Z' : (val.substring(0, 3) + ':' + val.substring(3));
|
184
|
+
});
|
185
|
+
}
|
186
|
+
tp_inst._defaults.timezoneList = timezoneList;
|
187
|
+
}
|
188
|
+
tp_inst.timezone = tp_inst._defaults.timezone;
|
189
|
+
tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin : tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
|
190
|
+
tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin : tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
|
191
|
+
tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin : tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;
|
192
|
+
tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin : tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
|
193
|
+
tp_inst.ampm = '';
|
194
|
+
tp_inst.$input = $input;
|
195
|
+
if (o.altField) {
|
196
|
+
tp_inst.$altInput = $(o.altField).css({
|
197
|
+
cursor: 'pointer'
|
198
|
+
}).focus(function() {
|
199
|
+
$input.trigger("focus");
|
200
|
+
});
|
201
|
+
}
|
202
|
+
if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
|
203
|
+
tp_inst._defaults.minDate = new Date();
|
204
|
+
}
|
205
|
+
if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {
|
206
|
+
tp_inst._defaults.maxDate = new Date();
|
207
|
+
}
|
208
|
+
if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
|
209
|
+
tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
|
210
|
+
}
|
211
|
+
if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
|
212
|
+
tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
|
213
|
+
}
|
214
|
+
if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
|
215
|
+
tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
|
216
|
+
}
|
217
|
+
if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
|
218
|
+
tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
|
219
|
+
}
|
220
|
+
tp_inst.$input.bind('focus', function() {
|
221
|
+
tp_inst._onFocus();
|
222
|
+
});
|
223
|
+
return tp_inst;
|
224
|
+
},
|
225
|
+
_addTimePicker: function(dp_inst) {
|
226
|
+
var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val();
|
227
|
+
this.timeDefined = this._parseTime(currDT);
|
228
|
+
this._limitMinMaxDateTime(dp_inst, false);
|
229
|
+
this._injectTimePicker();
|
230
|
+
},
|
231
|
+
_parseTime: function(timeString, withDate) {
|
232
|
+
try {
|
233
|
+
Typekit.load();
|
234
|
+
} catch (e) {};
|
235
|
+
if (!this.inst) {
|
236
|
+
this.inst = $.datepicker._getInst(this.$input[0]);
|
237
|
+
}
|
238
|
+
if (withDate || !this._defaults.timeOnly) {
|
239
|
+
var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
|
240
|
+
try {
|
241
|
+
var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
|
242
|
+
if (!parseRes.timeObj) {
|
243
|
+
return false;
|
244
|
+
}
|
245
|
+
$.extend(this, parseRes.timeObj);
|
246
|
+
} catch (err) {
|
247
|
+
$.timepicker.log("Error parsing the date/time string: " + err + "\ndate/time string = " + timeString + "\ntimeFormat = " + this._defaults.timeFormat + "\ndateFormat = " + dp_dateFormat);
|
248
|
+
return false;
|
249
|
+
}
|
250
|
+
return true;
|
251
|
+
} else {
|
252
|
+
var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
|
253
|
+
if (!timeObj) {
|
254
|
+
return false;
|
255
|
+
}
|
256
|
+
$.extend(this, timeObj);
|
257
|
+
return true;
|
258
|
+
}
|
259
|
+
},
|
260
|
+
_injectTimePicker: function() {
|
261
|
+
var $dp = this.inst.dpDiv,
|
262
|
+
o = this.inst.settings,
|
263
|
+
tp_inst = this,
|
264
|
+
litem = '',
|
265
|
+
uitem = '',
|
266
|
+
max = {},
|
267
|
+
gridSize = {},
|
268
|
+
size = null;
|
269
|
+
if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
|
270
|
+
var noDisplay = ' style="display:none;"',
|
271
|
+
html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label"' + ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' + '<dd class="ui_tpicker_time"' + ((o.showTime) ? '' : noDisplay) + '></dd>';
|
272
|
+
for (var i = 0, l = this.units.length; i < l; i++) {
|
273
|
+
litem = this.units[i];
|
274
|
+
uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
|
275
|
+
max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);
|
276
|
+
gridSize[litem] = 0;
|
277
|
+
html += '<dt class="ui_tpicker_' + litem + '_label"' + ((o['show' + uitem]) ? '' : noDisplay) + '>' + o[litem + 'Text'] + '</dt>' + '<dd class="ui_tpicker_' + litem + '"><div class="ui_tpicker_' + litem + '_slider"' + ((o['show' + uitem]) ? '' : noDisplay) + '></div>';
|
278
|
+
if (o['show' + uitem] && o[litem + 'Grid'] > 0) {
|
279
|
+
html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
|
280
|
+
if (litem == 'hour') {
|
281
|
+
for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) {
|
282
|
+
gridSize[litem]++;
|
283
|
+
var tmph = $.datepicker.formatTime(useAmpm(o.pickerTimeFormat || o.timeFormat) ? 'hht' : 'HH', {
|
284
|
+
hour: h
|
285
|
+
}, o);
|
286
|
+
html += '<td data-for="' + litem + '">' + tmph + '</td>';
|
287
|
+
}
|
288
|
+
} else {
|
289
|
+
for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) {
|
290
|
+
gridSize[litem]++;
|
291
|
+
html += '<td data-for="' + litem + '">' + ((m < 10) ? '0' : '') + m + '</td>';
|
292
|
+
}
|
293
|
+
}
|
294
|
+
html += '</tr></table></div>';
|
295
|
+
}
|
296
|
+
html += '</dd>';
|
297
|
+
}
|
298
|
+
html += '<dt class="ui_tpicker_timezone_label"' + ((o.showTimezone) ? '' : noDisplay) + '>' + o.timezoneText + '</dt>';
|
299
|
+
html += '<dd class="ui_tpicker_timezone" ' + ((o.showTimezone) ? '' : noDisplay) + '></dd>';
|
300
|
+
html += '</dl></div>';
|
301
|
+
var $tp = $(html);
|
302
|
+
if (o.timeOnly === true) {
|
303
|
+
$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
|
304
|
+
$dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
|
305
|
+
}
|
306
|
+
for (var i = 0, l = tp_inst.units.length; i < l; i++) {
|
307
|
+
litem = tp_inst.units[i];
|
308
|
+
uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
|
309
|
+
tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]);
|
310
|
+
if (o['show' + uitem] && o[litem + 'Grid'] > 0) {
|
311
|
+
size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']);
|
312
|
+
$tp.find('.ui_tpicker_' + litem + ' table').css({
|
313
|
+
width: size + "%",
|
314
|
+
marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + "%"),
|
315
|
+
marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0',
|
316
|
+
borderCollapse: 'collapse'
|
317
|
+
}).find("td").click(function(e) {
|
318
|
+
var $t = $(this),
|
319
|
+
h = $t.html(),
|
320
|
+
n = parseInt(h.replace(/[^0-9]/g), 10),
|
321
|
+
ap = h.replace(/[^apm]/ig),
|
322
|
+
f = $t.data('for');
|
323
|
+
if (f == 'hour') {
|
324
|
+
if (ap.indexOf('p') !== -1 && n < 12) {
|
325
|
+
n += 12;
|
326
|
+
} else {
|
327
|
+
if (ap.indexOf('a') !== -1 && n === 12) {
|
328
|
+
n = 0;
|
329
|
+
}
|
330
|
+
}
|
331
|
+
}
|
332
|
+
tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);
|
333
|
+
tp_inst._onTimeChange();
|
334
|
+
tp_inst._onSelectHandler();
|
335
|
+
})
|
336
|
+
.css({
|
337
|
+
cursor: 'pointer',
|
338
|
+
width: (100 / gridSize[litem]) + '%',
|
339
|
+
textAlign: 'center',
|
340
|
+
overflow: 'hidden'
|
341
|
+
});
|
342
|
+
}
|
343
|
+
}
|
344
|
+
this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find("select");
|
345
|
+
$.fn.append.apply(this.timezone_select, $.map(o.timezoneList, function(val, idx) {
|
346
|
+
return $("<option />").val(typeof val == "object" ? val.value : val).text(typeof val == "object" ? val.label : val);
|
347
|
+
}));
|
348
|
+
if (typeof(this.timezone) != "undefined" && this.timezone !== null && this.timezone !== "") {
|
349
|
+
var local_date = new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12);
|
350
|
+
var local_timezone = $.timepicker.timeZoneOffsetString(local_date);
|
351
|
+
if (local_timezone == this.timezone) {
|
352
|
+
selectLocalTimeZone(tp_inst);
|
353
|
+
} else {
|
354
|
+
this.timezone_select.val(this.timezone);
|
355
|
+
}
|
356
|
+
} else {
|
357
|
+
if (typeof(this.hour) != "undefined" && this.hour !== null && this.hour !== "") {
|
358
|
+
this.timezone_select.val(o.defaultTimezone);
|
359
|
+
} else {
|
360
|
+
selectLocalTimeZone(tp_inst);
|
361
|
+
}
|
362
|
+
}
|
363
|
+
this.timezone_select.change(function() {
|
364
|
+
tp_inst._defaults.useLocalTimezone = false;
|
365
|
+
tp_inst._onTimeChange();
|
366
|
+
tp_inst._onSelectHandler();
|
367
|
+
});
|
368
|
+
var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
|
369
|
+
if ($buttonPanel.length) {
|
370
|
+
$buttonPanel.before($tp);
|
371
|
+
} else {
|
372
|
+
$dp.append($tp);
|
373
|
+
}
|
374
|
+
this.$timeObj = $tp.find('.ui_tpicker_time');
|
375
|
+
if (this.inst !== null) {
|
376
|
+
var timeDefined = this.timeDefined;
|
377
|
+
this._onTimeChange();
|
378
|
+
this.timeDefined = timeDefined;
|
379
|
+
}
|
380
|
+
if (this._defaults.addSliderAccess) {
|
381
|
+
var sliderAccessArgs = this._defaults.sliderAccessArgs,
|
382
|
+
rtl = this._defaults.isRTL;
|
383
|
+
sliderAccessArgs.isRTL = rtl;
|
384
|
+
setTimeout(function() {
|
385
|
+
if ($tp.find('.ui-slider-access').length === 0) {
|
386
|
+
$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
|
387
|
+
var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);
|
388
|
+
if (sliderAccessWidth) {
|
389
|
+
$tp.find('table:visible').each(function() {
|
390
|
+
var $g = $(this),
|
391
|
+
oldWidth = $g.outerWidth(),
|
392
|
+
oldMarginLeft = $g.css(rtl ? 'marginRight' : 'marginLeft').toString().replace('%', ''),
|
393
|
+
newWidth = oldWidth - sliderAccessWidth,
|
394
|
+
newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%',
|
395
|
+
css = {
|
396
|
+
width: newWidth,
|
397
|
+
marginRight: 0,
|
398
|
+
marginLeft: 0
|
399
|
+
};
|
400
|
+
css[rtl ? 'marginRight' : 'marginLeft'] = newMarginLeft;
|
401
|
+
$g.css(css);
|
402
|
+
});
|
403
|
+
}
|
404
|
+
}
|
405
|
+
}, 10);
|
406
|
+
}
|
407
|
+
}
|
408
|
+
},
|
409
|
+
_limitMinMaxDateTime: function(dp_inst, adjustSliders) {
|
410
|
+
var o = this._defaults,
|
411
|
+
dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
|
412
|
+
if (!this._defaults.showTimepicker) {
|
413
|
+
return;
|
414
|
+
}
|
415
|
+
if ($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date) {
|
416
|
+
var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
|
417
|
+
minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
|
418
|
+
if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null) {
|
419
|
+
this.hourMinOriginal = o.hourMin;
|
420
|
+
this.minuteMinOriginal = o.minuteMin;
|
421
|
+
this.secondMinOriginal = o.secondMin;
|
422
|
+
this.millisecMinOriginal = o.millisecMin;
|
423
|
+
}
|
424
|
+
if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() == dp_date.getTime()) {
|
425
|
+
this._defaults.hourMin = minDateTime.getHours();
|
426
|
+
if (this.hour <= this._defaults.hourMin) {
|
427
|
+
this.hour = this._defaults.hourMin;
|
428
|
+
this._defaults.minuteMin = minDateTime.getMinutes();
|
429
|
+
if (this.minute <= this._defaults.minuteMin) {
|
430
|
+
this.minute = this._defaults.minuteMin;
|
431
|
+
this._defaults.secondMin = minDateTime.getSeconds();
|
432
|
+
if (this.second <= this._defaults.secondMin) {
|
433
|
+
this.second = this._defaults.secondMin;
|
434
|
+
this._defaults.millisecMin = minDateTime.getMilliseconds();
|
435
|
+
} else {
|
436
|
+
if (this.millisec < this._defaults.millisecMin) {
|
437
|
+
this.millisec = this._defaults.millisecMin;
|
438
|
+
}
|
439
|
+
this._defaults.millisecMin = this.millisecMinOriginal;
|
440
|
+
}
|
441
|
+
} else {
|
442
|
+
this._defaults.secondMin = this.secondMinOriginal;
|
443
|
+
this._defaults.millisecMin = this.millisecMinOriginal;
|
444
|
+
}
|
445
|
+
} else {
|
446
|
+
this._defaults.minuteMin = this.minuteMinOriginal;
|
447
|
+
this._defaults.secondMin = this.secondMinOriginal;
|
448
|
+
this._defaults.millisecMin = this.millisecMinOriginal;
|
449
|
+
}
|
450
|
+
} else {
|
451
|
+
this._defaults.hourMin = this.hourMinOriginal;
|
452
|
+
this._defaults.minuteMin = this.minuteMinOriginal;
|
453
|
+
this._defaults.secondMin = this.secondMinOriginal;
|
454
|
+
this._defaults.millisecMin = this.millisecMinOriginal;
|
455
|
+
}
|
456
|
+
}
|
457
|
+
if ($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date) {
|
458
|
+
var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
|
459
|
+
maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
|
460
|
+
if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null) {
|
461
|
+
this.hourMaxOriginal = o.hourMax;
|
462
|
+
this.minuteMaxOriginal = o.minuteMax;
|
463
|
+
this.secondMaxOriginal = o.secondMax;
|
464
|
+
this.millisecMaxOriginal = o.millisecMax;
|
465
|
+
}
|
466
|
+
if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() == dp_date.getTime()) {
|
467
|
+
this._defaults.hourMax = maxDateTime.getHours();
|
468
|
+
if (this.hour >= this._defaults.hourMax) {
|
469
|
+
this.hour = this._defaults.hourMax;
|
470
|
+
this._defaults.minuteMax = maxDateTime.getMinutes();
|
471
|
+
if (this.minute >= this._defaults.minuteMax) {
|
472
|
+
this.minute = this._defaults.minuteMax;
|
473
|
+
this._defaults.secondMax = maxDateTime.getSeconds();
|
474
|
+
if (this.second >= this._defaults.secondMax) {
|
475
|
+
this.second = this._defaults.secondMax;
|
476
|
+
this._defaults.millisecMax = maxDateTime.getMilliseconds();
|
477
|
+
} else {
|
478
|
+
if (this.millisec > this._defaults.millisecMax) {
|
479
|
+
this.millisec = this._defaults.millisecMax;
|
480
|
+
}
|
481
|
+
this._defaults.millisecMax = this.millisecMaxOriginal;
|
482
|
+
}
|
483
|
+
} else {
|
484
|
+
this._defaults.secondMax = this.secondMaxOriginal;
|
485
|
+
this._defaults.millisecMax = this.millisecMaxOriginal;
|
486
|
+
}
|
487
|
+
} else {
|
488
|
+
this._defaults.minuteMax = this.minuteMaxOriginal;
|
489
|
+
this._defaults.secondMax = this.secondMaxOriginal;
|
490
|
+
this._defaults.millisecMax = this.millisecMaxOriginal;
|
491
|
+
}
|
492
|
+
} else {
|
493
|
+
this._defaults.hourMax = this.hourMaxOriginal;
|
494
|
+
this._defaults.minuteMax = this.minuteMaxOriginal;
|
495
|
+
this._defaults.secondMax = this.secondMaxOriginal;
|
496
|
+
this._defaults.millisecMax = this.millisecMaxOriginal;
|
497
|
+
}
|
498
|
+
}
|
499
|
+
if (adjustSliders !== undefined && adjustSliders === true) {
|
500
|
+
var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
|
501
|
+
minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
|
502
|
+
secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10),
|
503
|
+
millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10);
|
504
|
+
if (this.hour_slider) {
|
505
|
+
this.control.options(this, this.hour_slider, 'hour', {
|
506
|
+
min: this._defaults.hourMin,
|
507
|
+
max: hourMax
|
508
|
+
});
|
509
|
+
this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour));
|
510
|
+
}
|
511
|
+
if (this.minute_slider) {
|
512
|
+
this.control.options(this, this.minute_slider, 'minute', {
|
513
|
+
min: this._defaults.minuteMin,
|
514
|
+
max: minMax
|
515
|
+
});
|
516
|
+
this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute));
|
517
|
+
}
|
518
|
+
if (this.second_slider) {
|
519
|
+
this.control.options(this, this.second_slider, 'second', {
|
520
|
+
min: this._defaults.secondMin,
|
521
|
+
max: secMax
|
522
|
+
});
|
523
|
+
this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond));
|
524
|
+
}
|
525
|
+
if (this.millisec_slider) {
|
526
|
+
this.control.options(this, this.millisec_slider, 'millisec', {
|
527
|
+
min: this._defaults.millisecMin,
|
528
|
+
max: millisecMax
|
529
|
+
});
|
530
|
+
this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec));
|
531
|
+
}
|
532
|
+
}
|
533
|
+
},
|
534
|
+
_onTimeChange: function() {
|
535
|
+
var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
|
536
|
+
minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
|
537
|
+
second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
|
538
|
+
millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
|
539
|
+
timezone = (this.timezone_select) ? this.timezone_select.val() : false,
|
540
|
+
o = this._defaults,
|
541
|
+
pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,
|
542
|
+
pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;
|
543
|
+
if (typeof(hour) == 'object') {
|
544
|
+
hour = false;
|
545
|
+
}
|
546
|
+
if (typeof(minute) == 'object') {
|
547
|
+
minute = false;
|
548
|
+
}
|
549
|
+
if (typeof(second) == 'object') {
|
550
|
+
second = false;
|
551
|
+
}
|
552
|
+
if (typeof(millisec) == 'object') {
|
553
|
+
millisec = false;
|
554
|
+
}
|
555
|
+
if (typeof(timezone) == 'object') {
|
556
|
+
timezone = false;
|
557
|
+
}
|
558
|
+
if (hour !== false) {
|
559
|
+
hour = parseInt(hour, 10);
|
560
|
+
}
|
561
|
+
if (minute !== false) {
|
562
|
+
minute = parseInt(minute, 10);
|
563
|
+
}
|
564
|
+
if (second !== false) {
|
565
|
+
second = parseInt(second, 10);
|
566
|
+
}
|
567
|
+
if (millisec !== false) {
|
568
|
+
millisec = parseInt(millisec, 10);
|
569
|
+
}
|
570
|
+
var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0];
|
571
|
+
var hasChanged = (hour != this.hour || minute != this.minute || second != this.second || millisec != this.millisec || (this.ampm.length > 0 && (hour < 12) != ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) || ((this.timezone === null && timezone != this.defaultTimezone) || (this.timezone !== null && timezone != this.timezone)));
|
572
|
+
if (hasChanged) {
|
573
|
+
if (hour !== false) {
|
574
|
+
this.hour = hour;
|
575
|
+
}
|
576
|
+
if (minute !== false) {
|
577
|
+
this.minute = minute;
|
578
|
+
}
|
579
|
+
if (second !== false) {
|
580
|
+
this.second = second;
|
581
|
+
}
|
582
|
+
if (millisec !== false) {
|
583
|
+
this.millisec = millisec;
|
584
|
+
}
|
585
|
+
if (timezone !== false) {
|
586
|
+
this.timezone = timezone;
|
587
|
+
}
|
588
|
+
if (!this.inst) {
|
589
|
+
this.inst = $.datepicker._getInst(this.$input[0]);
|
590
|
+
}
|
591
|
+
this._limitMinMaxDateTime(this.inst, true);
|
592
|
+
}
|
593
|
+
if (useAmpm(o.timeFormat)) {
|
594
|
+
this.ampm = ampm;
|
595
|
+
}
|
596
|
+
this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
|
597
|
+
if (this.$timeObj) {
|
598
|
+
if (pickerTimeFormat === o.timeFormat) {
|
599
|
+
this.$timeObj.text(this.formattedTime + pickerTimeSuffix);
|
600
|
+
} else {
|
601
|
+
this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
|
602
|
+
}
|
603
|
+
}
|
604
|
+
this.timeDefined = true;
|
605
|
+
if (hasChanged) {
|
606
|
+
this._updateDateTime();
|
607
|
+
}
|
608
|
+
},
|
609
|
+
_onSelectHandler: function() {
|
610
|
+
var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;
|
611
|
+
var inputEl = this.$input ? this.$input[0] : null;
|
612
|
+
if (onSelect && inputEl) {
|
613
|
+
onSelect.apply(inputEl, [this.formattedDateTime, this]);
|
614
|
+
}
|
615
|
+
},
|
616
|
+
_updateDateTime: function(dp_inst) {
|
617
|
+
dp_inst = this.inst || dp_inst;
|
618
|
+
var dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
|
619
|
+
dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
|
620
|
+
formatCfg = $.datepicker._getFormatConfig(dp_inst),
|
621
|
+
timeAvailable = dt !== null && this.timeDefined;
|
622
|
+
this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
|
623
|
+
var formattedDateTime = this.formattedDate;
|
624
|
+
if (dp_inst.lastVal == "") {
|
625
|
+
dp_inst.currentYear = dp_inst.selectedYear;
|
626
|
+
dp_inst.currentMonth = dp_inst.selectedMonth;
|
627
|
+
dp_inst.currentDay = dp_inst.selectedDay;
|
628
|
+
}
|
629
|
+
if (this._defaults.timeOnly === true) {
|
630
|
+
formattedDateTime = this.formattedTime;
|
631
|
+
} else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
|
632
|
+
formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
|
633
|
+
}
|
634
|
+
this.formattedDateTime = formattedDateTime;
|
635
|
+
if (!this._defaults.showTimepicker) {
|
636
|
+
this.$input.val(this.formattedDate);
|
637
|
+
} else if (this.$altInput && this._defaults.altFieldTimeOnly === true) {
|
638
|
+
this.$altInput.val(this.formattedTime);
|
639
|
+
this.$input.val(this.formattedDate);
|
640
|
+
} else if (this.$altInput) {
|
641
|
+
this.$input.val(formattedDateTime);
|
642
|
+
var altFormattedDateTime = '',
|
643
|
+
altSeparator = this._defaults.altSeparator ? this._defaults.altSeparator : this._defaults.separator,
|
644
|
+
altTimeSuffix = this._defaults.altTimeSuffix ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
|
645
|
+
if (this._defaults.altFormat) altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
|
646
|
+
else altFormattedDateTime = this.formattedDate;
|
647
|
+
if (altFormattedDateTime) altFormattedDateTime += altSeparator;
|
648
|
+
if (this._defaults.altTimeFormat) altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix;
|
649
|
+
else altFormattedDateTime += this.formattedTime + altTimeSuffix;
|
650
|
+
this.$altInput.val(altFormattedDateTime);
|
651
|
+
} else {
|
652
|
+
this.$input.val(formattedDateTime);
|
653
|
+
}
|
654
|
+
this.$input.trigger("change");
|
655
|
+
},
|
656
|
+
_onFocus: function() {
|
657
|
+
if (!this.$input.val() && this._defaults.defaultValue) {
|
658
|
+
this.$input.val(this._defaults.defaultValue);
|
659
|
+
var inst = $.datepicker._getInst(this.$input.get(0)),
|
660
|
+
tp_inst = $.datepicker._get(inst, 'timepicker');
|
661
|
+
if (tp_inst) {
|
662
|
+
if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
|
663
|
+
try {
|
664
|
+
$.datepicker._updateDatepicker(inst);
|
665
|
+
} catch (err) {
|
666
|
+
$.timepicker.log(err);
|
667
|
+
}
|
668
|
+
}
|
669
|
+
}
|
670
|
+
}
|
671
|
+
},
|
672
|
+
_controls: {
|
673
|
+
slider: {
|
674
|
+
create: function(tp_inst, obj, unit, val, min, max, step) {
|
675
|
+
var rtl = tp_inst._defaults.isRTL;
|
676
|
+
return obj.prop('slide', null).slider({
|
677
|
+
orientation: "horizontal",
|
678
|
+
value: rtl ? val * -1 : val,
|
679
|
+
min: rtl ? max * -1 : min,
|
680
|
+
max: rtl ? min * -1 : max,
|
681
|
+
step: step,
|
682
|
+
slide: function(event, ui) {
|
683
|
+
tp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value);
|
684
|
+
tp_inst._onTimeChange();
|
685
|
+
},
|
686
|
+
stop: function(event, ui) {
|
687
|
+
tp_inst._onSelectHandler();
|
688
|
+
}
|
689
|
+
});
|
690
|
+
},
|
691
|
+
options: function(tp_inst, obj, unit, opts, val) {
|
692
|
+
if (tp_inst._defaults.isRTL) {
|
693
|
+
if (typeof(opts) == 'string') {
|
694
|
+
if (opts == 'min' || opts == 'max') {
|
695
|
+
if (val !== undefined)
|
696
|
+
return obj.slider(opts, val * -1);
|
697
|
+
return Math.abs(obj.slider(opts));
|
698
|
+
}
|
699
|
+
return obj.slider(opts);
|
700
|
+
}
|
701
|
+
var min = opts.min,
|
702
|
+
max = opts.max;
|
703
|
+
opts.min = opts.max = null;
|
704
|
+
if (min !== undefined)
|
705
|
+
opts.max = min * -1;
|
706
|
+
if (max !== undefined)
|
707
|
+
opts.min = max * -1;
|
708
|
+
return obj.slider(opts);
|
709
|
+
}
|
710
|
+
if (typeof(opts) == 'string' && val !== undefined)
|
711
|
+
return obj.slider(opts, val);
|
712
|
+
return obj.slider(opts);
|
713
|
+
},
|
714
|
+
value: function(tp_inst, obj, unit, val) {
|
715
|
+
if (tp_inst._defaults.isRTL) {
|
716
|
+
if (val !== undefined)
|
717
|
+
return obj.slider('value', val * -1);
|
718
|
+
return Math.abs(obj.slider('value'));
|
719
|
+
}
|
720
|
+
if (val !== undefined)
|
721
|
+
return obj.slider('value', val);
|
722
|
+
return obj.slider('value');
|
723
|
+
}
|
724
|
+
},
|
725
|
+
select: {
|
726
|
+
create: function(tp_inst, obj, unit, val, min, max, step) {
|
727
|
+
var sel = '<select class="ui-timepicker-select" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">',
|
728
|
+
ul = tp_inst._defaults.timeFormat.indexOf('t') !== -1 ? 'toLowerCase' : 'toUpperCase',
|
729
|
+
m = 0;
|
730
|
+
for (var i = min; i <= max; i += step) {
|
731
|
+
sel += '<option value="' + i + '"' + (i == val ? ' selected' : '') + '>';
|
732
|
+
if (unit == 'hour' && useAmpm(tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat))
|
733
|
+
sel += $.datepicker.formatTime("hh TT", {
|
734
|
+
hour: i
|
735
|
+
}, tp_inst._defaults);
|
736
|
+
else if (unit == 'millisec' || i >= 10) sel += i;
|
737
|
+
else sel += '0' + i.toString();
|
738
|
+
sel += '</option>';
|
739
|
+
}
|
740
|
+
sel += '</select>';
|
741
|
+
obj.children('select').remove();
|
742
|
+
$(sel).appendTo(obj).change(function(e) {
|
743
|
+
tp_inst._onTimeChange();
|
744
|
+
tp_inst._onSelectHandler();
|
745
|
+
});
|
746
|
+
return obj;
|
747
|
+
},
|
748
|
+
options: function(tp_inst, obj, unit, opts, val) {
|
749
|
+
var o = {},
|
750
|
+
$t = obj.children('select');
|
751
|
+
if (typeof(opts) == 'string') {
|
752
|
+
if (val === undefined)
|
753
|
+
return $t.data(opts);
|
754
|
+
o[opts] = val;
|
755
|
+
} else o = opts;
|
756
|
+
return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min || $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
|
757
|
+
},
|
758
|
+
value: function(tp_inst, obj, unit, val) {
|
759
|
+
var $t = obj.children('select');
|
760
|
+
if (val !== undefined)
|
761
|
+
return $t.val(val);
|
762
|
+
return $t.val();
|
763
|
+
}
|
764
|
+
}
|
765
|
+
}
|
766
|
+
});
|
767
|
+
$.fn.extend({
|
768
|
+
timepicker: function(o) {
|
769
|
+
o = o || {};
|
770
|
+
var tmp_args = Array.prototype.slice.call(arguments);
|
771
|
+
if (typeof o == 'object') {
|
772
|
+
tmp_args[0] = $.extend(o, {
|
773
|
+
timeOnly: true
|
774
|
+
});
|
775
|
+
}
|
776
|
+
return $(this).each(function() {
|
777
|
+
$.fn.datetimepicker.apply($(this), tmp_args);
|
778
|
+
});
|
779
|
+
},
|
780
|
+
datetimepicker: function(o) {
|
781
|
+
o = o || {};
|
782
|
+
var tmp_args = arguments;
|
783
|
+
if (typeof(o) == 'string') {
|
784
|
+
if (o == 'getDate') {
|
785
|
+
return $.fn.datepicker.apply($(this[0]), tmp_args);
|
786
|
+
} else {
|
787
|
+
return this.each(function() {
|
788
|
+
var $t = $(this);
|
789
|
+
$t.datepicker.apply($t, tmp_args);
|
790
|
+
});
|
791
|
+
}
|
792
|
+
} else {
|
793
|
+
return this.each(function() {
|
794
|
+
var $t = $(this);
|
795
|
+
$t.datepicker($.timepicker._newInst($t, o)._defaults);
|
796
|
+
});
|
797
|
+
}
|
798
|
+
}
|
799
|
+
});
|
800
|
+
$.datepicker.parseDateTime = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
|
801
|
+
var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);
|
802
|
+
if (parseRes.timeObj) {
|
803
|
+
var t = parseRes.timeObj;
|
804
|
+
parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);
|
805
|
+
}
|
806
|
+
return parseRes.date;
|
807
|
+
};
|
808
|
+
$.datepicker.parseTime = function(timeFormat, timeString, options) {
|
809
|
+
var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {});
|
810
|
+
var strictParse = function(f, s, o) {
|
811
|
+
var getPatternAmpm = function(amNames, pmNames) {
|
812
|
+
var markers = [];
|
813
|
+
if (amNames) {
|
814
|
+
$.merge(markers, amNames);
|
815
|
+
}
|
816
|
+
if (pmNames) {
|
817
|
+
$.merge(markers, pmNames);
|
818
|
+
}
|
819
|
+
markers = $.map(markers, function(val) {
|
820
|
+
return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&');
|
821
|
+
});
|
822
|
+
return '(' + markers.join('|') + ')?';
|
823
|
+
};
|
824
|
+
var getFormatPositions = function(timeFormat) {
|
825
|
+
var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|t{1,2}|z|'.*?')/g),
|
826
|
+
orders = {
|
827
|
+
h: -1,
|
828
|
+
m: -1,
|
829
|
+
s: -1,
|
830
|
+
l: -1,
|
831
|
+
t: -1,
|
832
|
+
z: -1
|
833
|
+
};
|
834
|
+
if (finds) {
|
835
|
+
for (var i = 0; i < finds.length; i++) {
|
836
|
+
if (orders[finds[i].toString().charAt(0)] == -1) {
|
837
|
+
orders[finds[i].toString().charAt(0)] = i + 1;
|
838
|
+
}
|
839
|
+
}
|
840
|
+
}
|
841
|
+
return orders;
|
842
|
+
};
|
843
|
+
var regstr = '^' + f.toString()
|
844
|
+
.replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[lz]|'.*?')/g, function(match) {
|
845
|
+
var ml = match.length;
|
846
|
+
switch (match.charAt(0).toLowerCase()) {
|
847
|
+
case 'h':
|
848
|
+
return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
|
849
|
+
case 'm':
|
850
|
+
return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
|
851
|
+
case 's':
|
852
|
+
return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
|
853
|
+
case 'l':
|
854
|
+
return '(\\d?\\d?\\d)';
|
855
|
+
case 'z':
|
856
|
+
return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
|
857
|
+
case 't':
|
858
|
+
return getPatternAmpm(o.amNames, o.pmNames);
|
859
|
+
default:
|
860
|
+
return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function(m) {
|
861
|
+
return "\\" + m;
|
862
|
+
}) + ')?';
|
863
|
+
}
|
864
|
+
})
|
865
|
+
.replace(/\s/g, '\\s?') + o.timeSuffix + '$',
|
866
|
+
order = getFormatPositions(f),
|
867
|
+
ampm = '',
|
868
|
+
treg;
|
869
|
+
treg = s.match(new RegExp(regstr, 'i'));
|
870
|
+
var resTime = {
|
871
|
+
hour: 0,
|
872
|
+
minute: 0,
|
873
|
+
second: 0,
|
874
|
+
millisec: 0
|
875
|
+
};
|
876
|
+
if (treg) {
|
877
|
+
if (order.t !== -1) {
|
878
|
+
if (treg[order.t] === undefined || treg[order.t].length === 0) {
|
879
|
+
ampm = '';
|
880
|
+
resTime.ampm = '';
|
881
|
+
} else {
|
882
|
+
ampm = $.inArray(treg[order.t].toUpperCase(), o.amNames) !== -1 ? 'AM' : 'PM';
|
883
|
+
resTime.ampm = o[ampm == 'AM' ? 'amNames' : 'pmNames'][0];
|
884
|
+
}
|
885
|
+
}
|
886
|
+
if (order.h !== -1) {
|
887
|
+
if (ampm == 'AM' && treg[order.h] == '12') {
|
888
|
+
resTime.hour = 0;
|
889
|
+
} else {
|
890
|
+
if (ampm == 'PM' && treg[order.h] != '12') {
|
891
|
+
resTime.hour = parseInt(treg[order.h], 10) + 12;
|
892
|
+
} else {
|
893
|
+
resTime.hour = Number(treg[order.h]);
|
894
|
+
}
|
895
|
+
}
|
896
|
+
}
|
897
|
+
if (order.m !== -1) {
|
898
|
+
resTime.minute = Number(treg[order.m]);
|
899
|
+
}
|
900
|
+
if (order.s !== -1) {
|
901
|
+
resTime.second = Number(treg[order.s]);
|
902
|
+
}
|
903
|
+
if (order.l !== -1) {
|
904
|
+
resTime.millisec = Number(treg[order.l]);
|
905
|
+
}
|
906
|
+
if (order.z !== -1 && treg[order.z] !== undefined) {
|
907
|
+
var tz = treg[order.z].toUpperCase();
|
908
|
+
switch (tz.length) {
|
909
|
+
case 1:
|
910
|
+
tz = o.timezoneIso8601 ? 'Z' : '+0000';
|
911
|
+
break;
|
912
|
+
case 5:
|
913
|
+
if (o.timezoneIso8601) {
|
914
|
+
tz = tz.substring(1) == '0000' ? 'Z' : tz.substring(0, 3) + ':' + tz.substring(3);
|
915
|
+
}
|
916
|
+
break;
|
917
|
+
case 6:
|
918
|
+
if (!o.timezoneIso8601) {
|
919
|
+
tz = tz == 'Z' || tz.substring(1) == '00:00' ? '+0000' : tz.replace(/:/, '');
|
920
|
+
} else {
|
921
|
+
if (tz.substring(1) == '00:00') {
|
922
|
+
tz = 'Z';
|
923
|
+
}
|
924
|
+
}
|
925
|
+
break;
|
926
|
+
}
|
927
|
+
resTime.timezone = tz;
|
928
|
+
}
|
929
|
+
return resTime;
|
930
|
+
}
|
931
|
+
return false;
|
932
|
+
};
|
933
|
+
var looseParse = function(f, s, o) {
|
934
|
+
try {
|
935
|
+
var d = new Date('2012-01-01 ' + s);
|
936
|
+
if (isNaN(d.getTime())) {
|
937
|
+
d = new Date('2012-01-01T' + s);
|
938
|
+
if (isNaN(d.getTime())) {
|
939
|
+
d = new Date('01/01/2012 ' + s);
|
940
|
+
if (isNaN(d.getTime())) {
|
941
|
+
throw "Unable to parse time with native Date: " + s;
|
942
|
+
}
|
943
|
+
}
|
944
|
+
}
|
945
|
+
return {
|
946
|
+
hour: d.getHours(),
|
947
|
+
minute: d.getMinutes(),
|
948
|
+
second: d.getSeconds(),
|
949
|
+
millisec: d.getMilliseconds(),
|
950
|
+
timezone: $.timepicker.timeZoneOffsetString(d)
|
951
|
+
};
|
952
|
+
} catch (err) {
|
953
|
+
try {
|
954
|
+
return strictParse(f, s, o);
|
955
|
+
} catch (err2) {
|
956
|
+
$.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f);
|
957
|
+
}
|
958
|
+
}
|
959
|
+
return false;
|
960
|
+
};
|
961
|
+
if (typeof o.parse === "function") {
|
962
|
+
return o.parse(timeFormat, timeString, o)
|
963
|
+
}
|
964
|
+
if (o.parse === 'loose') {
|
965
|
+
return looseParse(timeFormat, timeString, o);
|
966
|
+
}
|
967
|
+
return strictParse(timeFormat, timeString, o);
|
968
|
+
};
|
969
|
+
$.datepicker.formatTime = function(format, time, options) {
|
970
|
+
options = options || {};
|
971
|
+
options = $.extend({}, $.timepicker._defaults, options);
|
972
|
+
time = $.extend({
|
973
|
+
hour: 0,
|
974
|
+
minute: 0,
|
975
|
+
second: 0,
|
976
|
+
millisec: 0,
|
977
|
+
timezone: '+0000'
|
978
|
+
}, time);
|
979
|
+
var tmptime = format,
|
980
|
+
ampmName = options.amNames[0],
|
981
|
+
hour = parseInt(time.hour, 10);
|
982
|
+
if (hour > 11) {
|
983
|
+
ampmName = options.pmNames[0];
|
984
|
+
}
|
985
|
+
tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[lz]|('.*?'|".*?"))/g, function(match) {
|
986
|
+
switch (match) {
|
987
|
+
case 'HH':
|
988
|
+
return ('0' + hour).slice(-2);
|
989
|
+
case 'H':
|
990
|
+
return hour;
|
991
|
+
case 'hh':
|
992
|
+
return ('0' + convert24to12(hour)).slice(-2);
|
993
|
+
case 'h':
|
994
|
+
return convert24to12(hour);
|
995
|
+
case 'mm':
|
996
|
+
return ('0' + time.minute).slice(-2);
|
997
|
+
case 'm':
|
998
|
+
return time.minute;
|
999
|
+
case 'ss':
|
1000
|
+
return ('0' + time.second).slice(-2);
|
1001
|
+
case 's':
|
1002
|
+
return time.second;
|
1003
|
+
case 'l':
|
1004
|
+
return ('00' + time.millisec).slice(-3);
|
1005
|
+
case 'z':
|
1006
|
+
return time.timezone === null ? options.defaultTimezone : time.timezone;
|
1007
|
+
case 'T':
|
1008
|
+
return ampmName.charAt(0).toUpperCase();
|
1009
|
+
case 'TT':
|
1010
|
+
return ampmName.toUpperCase();
|
1011
|
+
case 't':
|
1012
|
+
return ampmName.charAt(0).toLowerCase();
|
1013
|
+
case 'tt':
|
1014
|
+
return ampmName.toLowerCase();
|
1015
|
+
default:
|
1016
|
+
return match.replace(/\'/g, "") || "'";
|
1017
|
+
}
|
1018
|
+
});
|
1019
|
+
tmptime = $.trim(tmptime);
|
1020
|
+
return tmptime;
|
1021
|
+
};
|
1022
|
+
$.datepicker._base_selectDate = $.datepicker._selectDate;
|
1023
|
+
$.datepicker._selectDate = function(id, dateStr) {
|
1024
|
+
var inst = this._getInst($(id)[0]),
|
1025
|
+
tp_inst = this._get(inst, 'timepicker');
|
1026
|
+
if (tp_inst) {
|
1027
|
+
tp_inst._limitMinMaxDateTime(inst, true);
|
1028
|
+
inst.inline = inst.stay_open = true;
|
1029
|
+
this._base_selectDate(id, dateStr);
|
1030
|
+
inst.inline = inst.stay_open = false;
|
1031
|
+
this._notifyChange(inst);
|
1032
|
+
this._updateDatepicker(inst);
|
1033
|
+
} else {
|
1034
|
+
this._base_selectDate(id, dateStr);
|
1035
|
+
}
|
1036
|
+
};
|
1037
|
+
$.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
|
1038
|
+
$.datepicker._updateDatepicker = function(inst) {
|
1039
|
+
var input = inst.input[0];
|
1040
|
+
if ($.datepicker._curInst && $.datepicker._curInst != inst && $.datepicker._datepickerShowing && $.datepicker._lastInput != input) {
|
1041
|
+
return;
|
1042
|
+
}
|
1043
|
+
if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) {
|
1044
|
+
this._base_updateDatepicker(inst);
|
1045
|
+
var tp_inst = this._get(inst, 'timepicker');
|
1046
|
+
if (tp_inst) {
|
1047
|
+
tp_inst._addTimePicker(inst);
|
1048
|
+
}
|
1049
|
+
}
|
1050
|
+
};
|
1051
|
+
$.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
|
1052
|
+
$.datepicker._doKeyPress = function(event) {
|
1053
|
+
var inst = $.datepicker._getInst(event.target),
|
1054
|
+
tp_inst = $.datepicker._get(inst, 'timepicker');
|
1055
|
+
if (tp_inst) {
|
1056
|
+
if ($.datepicker._get(inst, 'constrainInput')) {
|
1057
|
+
var ampm = useAmpm(tp_inst._defaults.timeFormat),
|
1058
|
+
dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
|
1059
|
+
datetimeChars = tp_inst._defaults.timeFormat.toString()
|
1060
|
+
.replace(/[hms]/g, '')
|
1061
|
+
.replace(/TT/g, ampm ? 'APM' : '')
|
1062
|
+
.replace(/Tt/g, ampm ? 'AaPpMm' : '')
|
1063
|
+
.replace(/tT/g, ampm ? 'AaPpMm' : '')
|
1064
|
+
.replace(/T/g, ampm ? 'AP' : '')
|
1065
|
+
.replace(/tt/g, ampm ? 'apm' : '')
|
1066
|
+
.replace(/t/g, ampm ? 'ap' : '') + " " + tp_inst._defaults.separator + tp_inst._defaults.timeSuffix + (tp_inst._defaults.showTimezone ? tp_inst._defaults.timezoneList.join('') : '') + (tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) + dateChars,
|
1067
|
+
chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
|
1068
|
+
return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
|
1069
|
+
}
|
1070
|
+
}
|
1071
|
+
return $.datepicker._base_doKeyPress(event);
|
1072
|
+
};
|
1073
|
+
$.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
|
1074
|
+
$.datepicker._updateAlternate = function(inst) {
|
1075
|
+
var tp_inst = this._get(inst, 'timepicker');
|
1076
|
+
if (tp_inst) {
|
1077
|
+
var altField = tp_inst._defaults.altField;
|
1078
|
+
if (altField) {
|
1079
|
+
var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
|
1080
|
+
date = this._getDate(inst),
|
1081
|
+
formatCfg = $.datepicker._getFormatConfig(inst),
|
1082
|
+
altFormattedDateTime = '',
|
1083
|
+
altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
|
1084
|
+
altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
|
1085
|
+
altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
|
1086
|
+
altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
|
1087
|
+
if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {
|
1088
|
+
if (tp_inst._defaults.altFormat)
|
1089
|
+
altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime;
|
1090
|
+
else altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime;
|
1091
|
+
}
|
1092
|
+
$(altField).val(altFormattedDateTime);
|
1093
|
+
}
|
1094
|
+
} else {
|
1095
|
+
$.datepicker._base_updateAlternate(inst);
|
1096
|
+
}
|
1097
|
+
};
|
1098
|
+
$.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
|
1099
|
+
$.datepicker._doKeyUp = function(event) {
|
1100
|
+
var inst = $.datepicker._getInst(event.target),
|
1101
|
+
tp_inst = $.datepicker._get(inst, 'timepicker');
|
1102
|
+
if (tp_inst) {
|
1103
|
+
if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
|
1104
|
+
try {
|
1105
|
+
$.datepicker._updateDatepicker(inst);
|
1106
|
+
} catch (err) {
|
1107
|
+
$.timepicker.log(err);
|
1108
|
+
}
|
1109
|
+
}
|
1110
|
+
}
|
1111
|
+
return $.datepicker._base_doKeyUp(event);
|
1112
|
+
};
|
1113
|
+
$.datepicker._base_gotoToday = $.datepicker._gotoToday;
|
1114
|
+
$.datepicker._gotoToday = function(id) {
|
1115
|
+
var inst = this._getInst($(id)[0]),
|
1116
|
+
$dp = inst.dpDiv;
|
1117
|
+
this._base_gotoToday(id);
|
1118
|
+
var tp_inst = this._get(inst, 'timepicker');
|
1119
|
+
selectLocalTimeZone(tp_inst);
|
1120
|
+
var now = new Date();
|
1121
|
+
this._setTime(inst, now);
|
1122
|
+
$('.ui-datepicker-today', $dp).click();
|
1123
|
+
};
|
1124
|
+
$.datepicker._disableTimepickerDatepicker = function(target) {
|
1125
|
+
var inst = this._getInst(target);
|
1126
|
+
if (!inst) {
|
1127
|
+
return;
|
1128
|
+
}
|
1129
|
+
var tp_inst = this._get(inst, 'timepicker');
|
1130
|
+
$(target).datepicker('getDate');
|
1131
|
+
if (tp_inst) {
|
1132
|
+
tp_inst._defaults.showTimepicker = false;
|
1133
|
+
tp_inst._updateDateTime(inst);
|
1134
|
+
}
|
1135
|
+
};
|
1136
|
+
$.datepicker._enableTimepickerDatepicker = function(target) {
|
1137
|
+
var inst = this._getInst(target);
|
1138
|
+
if (!inst) {
|
1139
|
+
return;
|
1140
|
+
}
|
1141
|
+
var tp_inst = this._get(inst, 'timepicker');
|
1142
|
+
$(target).datepicker('getDate');
|
1143
|
+
if (tp_inst) {
|
1144
|
+
tp_inst._defaults.showTimepicker = true;
|
1145
|
+
tp_inst._addTimePicker(inst);
|
1146
|
+
tp_inst._updateDateTime(inst);
|
1147
|
+
}
|
1148
|
+
};
|
1149
|
+
$.datepicker._setTime = function(inst, date) {
|
1150
|
+
var tp_inst = this._get(inst, 'timepicker');
|
1151
|
+
if (tp_inst) {
|
1152
|
+
var defaults = tp_inst._defaults;
|
1153
|
+
tp_inst.hour = date ? date.getHours() : defaults.hour;
|
1154
|
+
tp_inst.minute = date ? date.getMinutes() : defaults.minute;
|
1155
|
+
tp_inst.second = date ? date.getSeconds() : defaults.second;
|
1156
|
+
tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
|
1157
|
+
tp_inst._limitMinMaxDateTime(inst, true);
|
1158
|
+
tp_inst._onTimeChange();
|
1159
|
+
tp_inst._updateDateTime(inst);
|
1160
|
+
}
|
1161
|
+
};
|
1162
|
+
$.datepicker._setTimeDatepicker = function(target, date, withDate) {
|
1163
|
+
var inst = this._getInst(target);
|
1164
|
+
if (!inst) {
|
1165
|
+
return;
|
1166
|
+
}
|
1167
|
+
var tp_inst = this._get(inst, 'timepicker');
|
1168
|
+
if (tp_inst) {
|
1169
|
+
this._setDateFromField(inst);
|
1170
|
+
var tp_date;
|
1171
|
+
if (date) {
|
1172
|
+
if (typeof date == "string") {
|
1173
|
+
tp_inst._parseTime(date, withDate);
|
1174
|
+
tp_date = new Date();
|
1175
|
+
tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
|
1176
|
+
} else {
|
1177
|
+
tp_date = new Date(date.getTime());
|
1178
|
+
}
|
1179
|
+
if (tp_date.toString() == 'Invalid Date') {
|
1180
|
+
tp_date = undefined;
|
1181
|
+
}
|
1182
|
+
this._setTime(inst, tp_date);
|
1183
|
+
}
|
1184
|
+
}
|
1185
|
+
};
|
1186
|
+
$.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
|
1187
|
+
$.datepicker._setDateDatepicker = function(target, date) {
|
1188
|
+
var inst = this._getInst(target);
|
1189
|
+
if (!inst) {
|
1190
|
+
return;
|
1191
|
+
}
|
1192
|
+
var tp_date = (date instanceof Date) ? new Date(date.getTime()) : date;
|
1193
|
+
this._updateDatepicker(inst);
|
1194
|
+
this._base_setDateDatepicker.apply(this, arguments);
|
1195
|
+
this._setTimeDatepicker(target, tp_date, true);
|
1196
|
+
};
|
1197
|
+
$.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
|
1198
|
+
$.datepicker._getDateDatepicker = function(target, noDefault) {
|
1199
|
+
var inst = this._getInst(target);
|
1200
|
+
if (!inst) {
|
1201
|
+
return;
|
1202
|
+
}
|
1203
|
+
var tp_inst = this._get(inst, 'timepicker');
|
1204
|
+
if (tp_inst) {
|
1205
|
+
if (inst.lastVal === undefined) {
|
1206
|
+
this._setDateFromField(inst, noDefault);
|
1207
|
+
}
|
1208
|
+
var date = this._getDate(inst);
|
1209
|
+
if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) {
|
1210
|
+
date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
|
1211
|
+
}
|
1212
|
+
return date;
|
1213
|
+
}
|
1214
|
+
return this._base_getDateDatepicker(target, noDefault);
|
1215
|
+
};
|
1216
|
+
$.datepicker._base_parseDate = $.datepicker.parseDate;
|
1217
|
+
$.datepicker.parseDate = function(format, value, settings) {
|
1218
|
+
var date;
|
1219
|
+
try {
|
1220
|
+
date = this._base_parseDate(format, value, settings);
|
1221
|
+
} catch (err) {
|
1222
|
+
date = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(':') - 2)), settings);
|
1223
|
+
$.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format);
|
1224
|
+
}
|
1225
|
+
return date;
|
1226
|
+
};
|
1227
|
+
$.datepicker._base_formatDate = $.datepicker._formatDate;
|
1228
|
+
$.datepicker._formatDate = function(inst, day, month, year) {
|
1229
|
+
var tp_inst = this._get(inst, 'timepicker');
|
1230
|
+
if (tp_inst) {
|
1231
|
+
tp_inst._updateDateTime(inst);
|
1232
|
+
return tp_inst.$input.val();
|
1233
|
+
}
|
1234
|
+
return this._base_formatDate(inst);
|
1235
|
+
};
|
1236
|
+
$.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
|
1237
|
+
$.datepicker._optionDatepicker = function(target, name, value) {
|
1238
|
+
var inst = this._getInst(target),
|
1239
|
+
name_clone;
|
1240
|
+
if (!inst) {
|
1241
|
+
return null;
|
1242
|
+
}
|
1243
|
+
var tp_inst = this._get(inst, 'timepicker');
|
1244
|
+
if (tp_inst) {
|
1245
|
+
var min = null,
|
1246
|
+
max = null,
|
1247
|
+
onselect = null,
|
1248
|
+
overrides = tp_inst._defaults.evnts,
|
1249
|
+
fns = {},
|
1250
|
+
prop;
|
1251
|
+
if (typeof name == 'string') {
|
1252
|
+
if (name === 'minDate' || name === 'minDateTime') {
|
1253
|
+
min = value;
|
1254
|
+
} else if (name === 'maxDate' || name === 'maxDateTime') {
|
1255
|
+
max = value;
|
1256
|
+
} else if (name === 'onSelect') {
|
1257
|
+
onselect = value;
|
1258
|
+
} else if (overrides.hasOwnProperty(name)) {
|
1259
|
+
if (typeof(value) === 'undefined') {
|
1260
|
+
return overrides[name];
|
1261
|
+
}
|
1262
|
+
fns[name] = value;
|
1263
|
+
name_clone = {};
|
1264
|
+
}
|
1265
|
+
} else if (typeof name == 'object') {
|
1266
|
+
if (name.minDate) {
|
1267
|
+
min = name.minDate;
|
1268
|
+
} else if (name.minDateTime) {
|
1269
|
+
min = name.minDateTime;
|
1270
|
+
} else if (name.maxDate) {
|
1271
|
+
max = name.maxDate;
|
1272
|
+
} else if (name.maxDateTime) {
|
1273
|
+
max = name.maxDateTime;
|
1274
|
+
}
|
1275
|
+
for (prop in overrides) {
|
1276
|
+
if (overrides.hasOwnProperty(prop) && name[prop]) {
|
1277
|
+
fns[prop] = name[prop];
|
1278
|
+
}
|
1279
|
+
}
|
1280
|
+
}
|
1281
|
+
for (prop in fns) {
|
1282
|
+
if (fns.hasOwnProperty(prop)) {
|
1283
|
+
overrides[prop] = fns[prop];
|
1284
|
+
if (!name_clone) {
|
1285
|
+
name_clone = $.extend({}, name);
|
1286
|
+
}
|
1287
|
+
delete name_clone[prop];
|
1288
|
+
}
|
1289
|
+
}
|
1290
|
+
if (name_clone && isEmptyObject(name_clone)) {
|
1291
|
+
return;
|
1292
|
+
}
|
1293
|
+
if (min) {
|
1294
|
+
if (min === 0) {
|
1295
|
+
min = new Date();
|
1296
|
+
} else {
|
1297
|
+
min = new Date(min);
|
1298
|
+
}
|
1299
|
+
tp_inst._defaults.minDate = min;
|
1300
|
+
tp_inst._defaults.minDateTime = min;
|
1301
|
+
} else if (max) {
|
1302
|
+
if (max === 0) {
|
1303
|
+
max = new Date();
|
1304
|
+
} else {
|
1305
|
+
max = new Date(max);
|
1306
|
+
}
|
1307
|
+
tp_inst._defaults.maxDate = max;
|
1308
|
+
tp_inst._defaults.maxDateTime = max;
|
1309
|
+
} else if (onselect) {
|
1310
|
+
tp_inst._defaults.onSelect = onselect;
|
1311
|
+
}
|
1312
|
+
}
|
1313
|
+
if (value === undefined) {
|
1314
|
+
return this._base_optionDatepicker.call($.datepicker, target, name);
|
1315
|
+
}
|
1316
|
+
return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
|
1317
|
+
};
|
1318
|
+
var isEmptyObject = function(obj) {
|
1319
|
+
var prop;
|
1320
|
+
for (prop in obj) {
|
1321
|
+
if (obj.hasOwnProperty(obj)) {
|
1322
|
+
return false;
|
1323
|
+
}
|
1324
|
+
}
|
1325
|
+
return true;
|
1326
|
+
};
|
1327
|
+
var extendRemove = function(target, props) {
|
1328
|
+
$.extend(target, props);
|
1329
|
+
for (var name in props) {
|
1330
|
+
if (props[name] === null || props[name] === undefined) {
|
1331
|
+
target[name] = props[name];
|
1332
|
+
}
|
1333
|
+
}
|
1334
|
+
return target;
|
1335
|
+
};
|
1336
|
+
var useAmpm = function(timeFormat) {
|
1337
|
+
return (timeFormat.indexOf('t') !== -1 && timeFormat.indexOf('h') !== -1);
|
1338
|
+
};
|
1339
|
+
var convert24to12 = function(hour) {
|
1340
|
+
if (hour > 12) {
|
1341
|
+
hour = hour - 12;
|
1342
|
+
}
|
1343
|
+
if (hour == 0) {
|
1344
|
+
hour = 12;
|
1345
|
+
}
|
1346
|
+
return String(hour);
|
1347
|
+
};
|
1348
|
+
var splitDateTime = function(dateFormat, dateTimeString, dateSettings, timeSettings) {
|
1349
|
+
try {
|
1350
|
+
var separator = timeSettings && timeSettings.separator ? timeSettings.separator : $.timepicker._defaults.separator,
|
1351
|
+
format = timeSettings && timeSettings.timeFormat ? timeSettings.timeFormat : $.timepicker._defaults.timeFormat,
|
1352
|
+
timeParts = format.split(separator),
|
1353
|
+
timePartsLen = timeParts.length,
|
1354
|
+
allParts = dateTimeString.split(separator),
|
1355
|
+
allPartsLen = allParts.length;
|
1356
|
+
if (allPartsLen > 1) {
|
1357
|
+
return [allParts.splice(0, allPartsLen - timePartsLen).join(separator), allParts.splice(0, timePartsLen).join(separator)];
|
1358
|
+
}
|
1359
|
+
} catch (err) {
|
1360
|
+
$.timepicker.log('Could not split the date from the time. Please check the following datetimepicker options' + "\nthrown error: " + err + "\ndateTimeString" + dateTimeString + "\ndateFormat = " + dateFormat + "\nseparator = " + timeSettings.separator + "\ntimeFormat = " + timeSettings.timeFormat);
|
1361
|
+
if (err.indexOf(":") >= 0) {
|
1362
|
+
var dateStringLength = dateTimeString.length - (err.length - err.indexOf(':') - 2),
|
1363
|
+
timeString = dateTimeString.substring(dateStringLength);
|
1364
|
+
return [$.trim(dateTimeString.substring(0, dateStringLength)), $.trim(dateTimeString.substring(dateStringLength))];
|
1365
|
+
} else {
|
1366
|
+
throw err;
|
1367
|
+
}
|
1368
|
+
}
|
1369
|
+
return [dateTimeString, ''];
|
1370
|
+
};
|
1371
|
+
var parseDateTimeInternal = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
|
1372
|
+
var date;
|
1373
|
+
var splitRes = splitDateTime(dateFormat, dateTimeString, dateSettings, timeSettings);
|
1374
|
+
date = $.datepicker._base_parseDate(dateFormat, splitRes[0], dateSettings);
|
1375
|
+
if (splitRes[1] !== '') {
|
1376
|
+
var timeString = splitRes[1],
|
1377
|
+
parsedTime = $.datepicker.parseTime(timeFormat, timeString, timeSettings);
|
1378
|
+
if (parsedTime === null) {
|
1379
|
+
throw 'Wrong time format';
|
1380
|
+
}
|
1381
|
+
return {
|
1382
|
+
date: date,
|
1383
|
+
timeObj: parsedTime
|
1384
|
+
};
|
1385
|
+
} else {
|
1386
|
+
return {
|
1387
|
+
date: date
|
1388
|
+
};
|
1389
|
+
}
|
1390
|
+
};
|
1391
|
+
var selectLocalTimeZone = function(tp_inst, date) {
|
1392
|
+
if (tp_inst && tp_inst.timezone_select) {
|
1393
|
+
tp_inst._defaults.useLocalTimezone = true;
|
1394
|
+
var now = typeof date !== 'undefined' ? date : new Date();
|
1395
|
+
var tzoffset = $.timepicker.timeZoneOffsetString(now);
|
1396
|
+
if (tp_inst._defaults.timezoneIso8601) {
|
1397
|
+
tzoffset = tzoffset.substring(0, 3) + ':' + tzoffset.substring(3);
|
1398
|
+
}
|
1399
|
+
tp_inst.timezone_select.val(tzoffset);
|
1400
|
+
}
|
1401
|
+
};
|
1402
|
+
$.timepicker = new Timepicker();
|
1403
|
+
$.timepicker.timeZoneOffsetString = function(date) {
|
1404
|
+
var off = date.getTimezoneOffset() * -1,
|
1405
|
+
minutes = off % 60,
|
1406
|
+
hours = (off - minutes) / 60;
|
1407
|
+
return (off >= 0 ? '+' : '-') + ('0' + (hours * 101).toString()).slice(-2) + ('0' + (minutes * 101).toString()).slice(-2);
|
1408
|
+
};
|
1409
|
+
$.timepicker.timeRange = function(startTime, endTime, options) {
|
1410
|
+
return $.timepicker.handleRange('timepicker', startTime, endTime, options);
|
1411
|
+
};
|
1412
|
+
$.timepicker.dateTimeRange = function(startTime, endTime, options) {
|
1413
|
+
$.timepicker.dateRange(startTime, endTime, options, 'datetimepicker');
|
1414
|
+
};
|
1415
|
+
$.timepicker.dateRange = function(startTime, endTime, options, method) {
|
1416
|
+
method = method || 'datepicker';
|
1417
|
+
$.timepicker.handleRange(method, startTime, endTime, options);
|
1418
|
+
};
|
1419
|
+
$.timepicker.handleRange = function(method, startTime, endTime, options) {
|
1420
|
+
$.fn[method].call(startTime, $.extend({
|
1421
|
+
onClose: function(dateText, inst) {
|
1422
|
+
checkDates(this, endTime, dateText);
|
1423
|
+
},
|
1424
|
+
onSelect: function(selectedDateTime) {
|
1425
|
+
selected(this, endTime, 'minDate');
|
1426
|
+
}
|
1427
|
+
}, options, options.start));
|
1428
|
+
$.fn[method].call(endTime, $.extend({
|
1429
|
+
onClose: function(dateText, inst) {
|
1430
|
+
checkDates(this, startTime, dateText);
|
1431
|
+
},
|
1432
|
+
onSelect: function(selectedDateTime) {
|
1433
|
+
selected(this, startTime, 'maxDate');
|
1434
|
+
}
|
1435
|
+
}, options, options.end));
|
1436
|
+
if (method != 'timepicker' && options.reformat) {
|
1437
|
+
$([startTime, endTime]).each(function() {
|
1438
|
+
var format = $(this)[method].call($(this), 'option', 'dateFormat'),
|
1439
|
+
date = new Date($(this).val());
|
1440
|
+
if ($(this).val() && date) {
|
1441
|
+
$(this).val($.datepicker.formatDate(format, date));
|
1442
|
+
}
|
1443
|
+
});
|
1444
|
+
}
|
1445
|
+
checkDates(startTime, endTime, startTime.val());
|
1446
|
+
|
1447
|
+
function checkDates(changed, other, dateText) {
|
1448
|
+
if (other.val() && (new Date(startTime.val()) > new Date(endTime.val()))) {
|
1449
|
+
other.val(dateText);
|
1450
|
+
}
|
1451
|
+
}
|
1452
|
+
selected(startTime, endTime, 'minDate');
|
1453
|
+
selected(endTime, startTime, 'maxDate');
|
1454
|
+
|
1455
|
+
function selected(changed, other, option) {
|
1456
|
+
if (!$(changed).val()) {
|
1457
|
+
return;
|
1458
|
+
}
|
1459
|
+
var date = $(changed)[method].call($(changed), 'getDate');
|
1460
|
+
if (date.getTime) {
|
1461
|
+
$(other)[method].call($(other), 'option', option, date);
|
1462
|
+
}
|
1463
|
+
}
|
1464
|
+
return $([startTime.get(0), endTime.get(0)]);
|
1465
|
+
};
|
1466
|
+
$.timepicker.log = function(err) {
|
1467
|
+
if (window.console)
|
1468
|
+
console.log(err);
|
1469
|
+
};
|
1470
|
+
$.timepicker.version = "1.2";
|
1471
|
+
})(jQuery);
|