Skip to content

Commit

Permalink
#843 and #845 - fix for clicking Now button
Browse files Browse the repository at this point in the history
  • Loading branch information
trentrichardson committed Nov 23, 2015
1 parent 4aac8f1 commit bdafae6
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/i18n/jquery-ui-timepicker-addon-i18n.js
@@ -1,4 +1,4 @@
/*! jQuery Timepicker Addon - v1.6.1 - 2015-11-14
/*! jQuery Timepicker Addon - v1.6.2 - 2015-11-14
* http://trentrichardson.com/examples/timepicker
* Copyright (c) 2015 Trent Richardson; Licensed MIT */

Expand Down
2 changes: 1 addition & 1 deletion dist/i18n/jquery-ui-timepicker-addon-i18n.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.html
Expand Up @@ -113,7 +113,7 @@ <h3>Requirements</h3>

<br />
<h3>Version</h3>
<p>Version 1.6.1</p>
<p>Version 1.6.2</p>

<p>Last updated on 2015-11-14</p>
<p>jQuery Timepicker Addon is currently available for use in all personal or commercial projects under the MIT license.</p>
Expand Down
12 changes: 8 additions & 4 deletions dist/jquery-ui-timepicker-addon.js
@@ -1,4 +1,4 @@
/*! jQuery Timepicker Addon - v1.6.1 - 2015-11-14
/*! jQuery Timepicker Addon - v1.6.2 - 2015-11-14
* http://trentrichardson.com/examples/timepicker
* Copyright (c) 2015 Trent Richardson; Licensed MIT */
(function (factory) {
Expand All @@ -22,7 +22,7 @@
*/
$.extend($.ui, {
timepicker: {
version: "1.6.1"
version: "1.6.2"
}
});

Expand Down Expand Up @@ -2059,10 +2059,14 @@
return 0;
}

if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back
if(/^[a-zA-Z -]+$/.test(normalized)){ // possibly a user defined tz, so just give it back
return tzString;
}

if (!/^(\-|\+)\d{4}$/.test(normalized)) {
return parseInt(tzString, 10);
}

return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus
((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes)
parseInt(normalized.substr(3, 2), 10))); // minutes
Expand Down Expand Up @@ -2258,6 +2262,6 @@
/*
* Keep up with the version
*/
$.timepicker.version = "1.6.1";
$.timepicker.version = "1.6.2";

}));
2 changes: 1 addition & 1 deletion dist/jquery-ui-timepicker-addon.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/jquery-ui-timepicker-addon.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/jquery-ui-timepicker-addon.js
Expand Up @@ -2065,10 +2065,14 @@
return 0;
}

if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back
if(/^[a-zA-Z -]+$/.test(normalized)){ // possibly a user defined tz, so just give it back
return tzString;
}

if (!/^(\-|\+)\d{4}$/.test(normalized)) {
return parseInt(tzString, 10);
}

return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus
((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes)
parseInt(normalized.substr(3, 2), 10))); // minutes
Expand Down

0 comments on commit bdafae6

Please sign in to comment.