|
29 | 29 | this.template = options.template;
|
30 | 30 | this.appendWidgetTo = options.appendWidgetTo;
|
31 | 31 | this.showWidgetOnAddonClick = options.showWidgetOnAddonClick;
|
32 |
| - |
| 32 | + this.timeSeparator = options.timeSeparator; |
33 | 33 | this._init();
|
34 | 34 | };
|
35 | 35 |
|
|
269 | 269 | '</tr>'+
|
270 | 270 | '<tr>'+
|
271 | 271 | '<td>'+ hourTemplate +'</td> '+
|
272 |
| - '<td class="separator">:</td>'+ |
| 272 | + '<td class="separator">' + this.timeSeparator + '</td>'+ |
273 | 273 | '<td>'+ minuteTemplate +'</td> '+
|
274 | 274 | (this.showSeconds ?
|
275 |
| - '<td class="separator">:</td>'+ |
| 275 | + '<td class="separator">' + this.timeSeparator + '</td>'+ |
276 | 276 | '<td>'+ secondTemplate +'</td>'
|
277 | 277 | : '') +
|
278 | 278 | (this.showMeridian ?
|
|
323 | 323 | return '';
|
324 | 324 | }
|
325 | 325 |
|
326 |
| - return this.hour + ':' + (this.minute.toString().length === 1 ? '0' + this.minute : this.minute) + (this.showSeconds ? ':' + (this.second.toString().length === 1 ? '0' + this.second : this.second) : '') + (this.showMeridian ? ' ' + this.meridian : ''); |
| 326 | + return this.hour + this.timeSeparator + (this.minute.toString().length === 1 ? '0' + this.minute : this.minute) + (this.showSeconds ? this.timeSeparator + (this.second.toString().length === 1 ? '0' + this.second : this.second) : '') + (this.showMeridian ? ' ' + this.meridian : ''); |
327 | 327 | },
|
328 | 328 |
|
329 | 329 | hideWidget: function() {
|
|
763 | 763 | } else {
|
764 | 764 | meridian = 'AM';
|
765 | 765 | }
|
766 |
| - |
767 |
| - time = time.replace(/[^0-9\:]/g, ''); |
768 |
| - |
769 |
| - timeArray = time.split(':'); |
| 766 | + // Don't know how to include dynamically a char do both [.:] |
| 767 | + time = time.replace(/[^0-9\:\.]/g, ''); |
| 768 | + timeArray = time.split(this.timeSeparator); |
770 | 769 |
|
771 | 770 | hour = timeArray[0] ? timeArray[0].toString() : timeArray.toString();
|
772 | 771 | minute = timeArray[1] ? timeArray[1].toString() : '';
|
|
887 | 886 | if (this.defaultTime) {
|
888 | 887 | this.setDefaultTime(this.defaultTime);
|
889 | 888 | } else {
|
890 |
| - this.setTime('0:0:0'); |
| 889 | + this.setTime('0' + this.timeSeparator + '0' + this.timeSeparator + '0'); |
891 | 890 | }
|
892 | 891 | }
|
893 | 892 |
|
|
969 | 968 | return;
|
970 | 969 | }
|
971 | 970 |
|
972 |
| - var t = this.$widget.find('input.bootstrap-timepicker-hour').val() + ':' + |
| 971 | + var t = this.$widget.find('input.bootstrap-timepicker-hour').val() + this.timeSeparator + |
973 | 972 | this.$widget.find('input.bootstrap-timepicker-minute').val() +
|
974 |
| - (this.showSeconds ? ':' + this.$widget.find('input.bootstrap-timepicker-second').val() : '') + |
| 973 | + (this.showSeconds ? this.timeSeparator + this.$widget.find('input.bootstrap-timepicker-second').val() : '') + |
975 | 974 | (this.showMeridian ? this.$widget.find('input.bootstrap-timepicker-meridian').val() : '')
|
976 | 975 | ;
|
977 | 976 |
|
|
1089 | 1088 | showMeridian: true,
|
1090 | 1089 | template: 'dropdown',
|
1091 | 1090 | appendWidgetTo: 'body',
|
1092 |
| - showWidgetOnAddonClick: true |
| 1091 | + showWidgetOnAddonClick: true, |
| 1092 | + timeSeparator : ':' |
1093 | 1093 | };
|
1094 | 1094 |
|
1095 | 1095 | $.fn.timepicker.Constructor = Timepicker;
|
|
0 commit comments