|
1 | | -/*! jQuery Timepicker Addon - v1.4 - 2013-08-11 |
| 1 | +/*! jQuery Timepicker Addon - v1.4.3 - 2013-11-30 |
2 | 2 | * http://trentrichardson.com/examples/timepicker |
3 | 3 | * Copyright (c) 2013 Trent Richardson; Licensed MIT */ |
4 | 4 | (function ($) { |
|
16 | 16 | */ |
17 | 17 | $.extend($.ui, { |
18 | 18 | timepicker: { |
19 | | - version: "1.4" |
| 19 | + version: "1.4.3" |
20 | 20 | } |
21 | 21 | }); |
22 | 22 |
|
|
743 | 743 | if (microsec !== false) { |
744 | 744 | microsec = parseInt(microsec, 10); |
745 | 745 | } |
| 746 | + if (timezone !== false) { |
| 747 | + timezone = timezone.toString(); |
| 748 | + } |
746 | 749 |
|
747 | 750 | var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0]; |
748 | 751 |
|
749 | 752 | // If the update was done in the input field, the input field should not be updated. |
750 | 753 | // If the update was done using the sliders, update the input field. |
751 | | - var hasChanged = (hour !== this.hour || minute !== this.minute || second !== this.second || millisec !== this.millisec || microsec !== this.microsec || |
752 | | - (this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) || (this.timezone !== null && timezone !== this.timezone)); |
| 754 | + var hasChanged = ( |
| 755 | + hour !== parseInt(this.hour,10) || // sliders should all be numeric |
| 756 | + minute !== parseInt(this.minute,10) || |
| 757 | + second !== parseInt(this.second,10) || |
| 758 | + millisec !== parseInt(this.millisec,10) || |
| 759 | + microsec !== parseInt(this.microsec,10) || |
| 760 | + (this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) || |
| 761 | + (this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString() |
| 762 | + ); |
753 | 763 |
|
754 | 764 | if (hasChanged) { |
755 | 765 |
|
|
796 | 806 | this.timeDefined = true; |
797 | 807 | if (hasChanged) { |
798 | 808 | this._updateDateTime(); |
| 809 | + this.$input.focus(); |
799 | 810 | } |
800 | 811 | }, |
801 | 812 |
|
|
829 | 840 | var formattedDateTime = this.formattedDate; |
830 | 841 |
|
831 | 842 | // if a slider was changed but datepicker doesn't have a value yet, set it |
832 | | - if (dp_inst.lastVa === "") { |
| 843 | + if (dp_inst.lastVal === "") { |
833 | 844 | dp_inst.currentYear = dp_inst.selectedYear; |
834 | 845 | dp_inst.currentMonth = dp_inst.selectedMonth; |
835 | 846 | dp_inst.currentDay = dp_inst.selectedDay; |
|
1594 | 1605 | // object will only return the timezone offset for the current locale, so we |
1595 | 1606 | // adjust it accordingly. If not using timezone option this won't matter.. |
1596 | 1607 | // If a timezone is different in tp, keep the timezone as is |
1597 | | - if (tp_inst) { |
| 1608 | + if (tp_inst && tp_date) { |
1598 | 1609 | // look out for DST if tz wasn't specified |
1599 | 1610 | if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) { |
1600 | 1611 | tp_inst.timezone = tp_date.getTimezoneOffset() * -1; |
|
2129 | 2140 | /* |
2130 | 2141 | * Keep up with the version |
2131 | 2142 | */ |
2132 | | - $.timepicker.version = "1.4"; |
| 2143 | + $.timepicker.version = "1.4.3"; |
2133 | 2144 |
|
2134 | 2145 | })(jQuery); |
0 commit comments