|
1 | 1 | /*
|
2 | 2 | * jQuery timepicker addon
|
3 | 3 | * By: Trent Richardson [http://trentrichardson.com]
|
4 |
| -* Version 0.9.4 |
| 4 | +* Version 0.9.5-dev |
5 | 5 | * Last Modified: 05/12/2011
|
6 | 6 | *
|
7 | 7 | * Copyright 2011 Trent Richardson
|
@@ -501,7 +501,7 @@ $.extend(Timepicker.prototype, {
|
501 | 501 | //Emulate datepicker onSelect behavior. Call on slidestop.
|
502 | 502 | var onSelectDelegate = function() {
|
503 | 503 | tp_inst._onSelectHandler();
|
504 |
| - } |
| 504 | + }; |
505 | 505 | this.hour_slider.bind('slidestop',onSelectDelegate);
|
506 | 506 | this.minute_slider.bind('slidestop',onSelectDelegate);
|
507 | 507 | this.second_slider.bind('slidestop',onSelectDelegate);
|
@@ -601,7 +601,7 @@ $.extend(Timepicker.prototype, {
|
601 | 601 | var hour = (this.hour_slider) ? this.hour_slider.slider('value') : false,
|
602 | 602 | minute = (this.minute_slider) ? this.minute_slider.slider('value') : false,
|
603 | 603 | second = (this.second_slider) ? this.second_slider.slider('value') : false,
|
604 |
| - timezone = (this.timezone_select) ? this.timezone_select.val() : false |
| 604 | + timezone = (this.timezone_select) ? this.timezone_select.val() : false; |
605 | 605 |
|
606 | 606 | if (hour !== false) hour = parseInt(hour,10);
|
607 | 607 | if (minute !== false) minute = parseInt(minute,10);
|
@@ -660,6 +660,8 @@ $.extend(Timepicker.prototype, {
|
660 | 660 | .replace(/ss/g, ((time.second < 10) ? '0' : '') + time.second)
|
661 | 661 | .replace(/s/g, time.second)
|
662 | 662 | .replace(/TT/g, time.ampm.toUpperCase())
|
| 663 | + .replace(/Tt/g, time.ampm.toUpperCase()) |
| 664 | + .replace(/tT/g, time.ampm.toLowerCase()) |
663 | 665 | .replace(/tt/g, time.ampm.toLowerCase())
|
664 | 666 | .replace(/T/g, time.ampm.charAt(0).toUpperCase())
|
665 | 667 | .replace(/t/g, time.ampm.charAt(0).toLowerCase())
|
@@ -810,6 +812,8 @@ $.datepicker._doKeyPress = function(event) {
|
810 | 812 | datetimeChars = tp_inst._defaults.timeFormat.toString()
|
811 | 813 | .replace(/[hms]/g, '')
|
812 | 814 | .replace(/TT/g, ampm ? 'APM' : '')
|
| 815 | + .replace(/Tt/g, ampm ? 'AaPpMm' : '') |
| 816 | + .replace(/tT/g, ampm ? 'AaPpMm' : '') |
813 | 817 | .replace(/T/g, ampm ? 'AP' : '')
|
814 | 818 | .replace(/tt/g, ampm ? 'apm' : '')
|
815 | 819 | .replace(/t/g, ampm ? 'ap' : '') +
|
@@ -958,7 +962,7 @@ $.datepicker._getDateDatepicker = function(target, noDefault) {
|
958 | 962 | if (tp_inst) {
|
959 | 963 | this._setDateFromField(inst, noDefault);
|
960 | 964 | var date = this._getDate(inst);
|
961 |
| - if (date && tp_inst._parseTime($(target).val(), true)) date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second); |
| 965 | + if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second); |
962 | 966 | return date;
|
963 | 967 | }
|
964 | 968 | return this._base_getDateDatepicker(target, noDefault);
|
|
0 commit comments