diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jquery-ui-timepicker-addon.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jquery-ui-timepicker-addon.js b/src/jquery-ui-timepicker-addon.js index 79de1e3..6ba792e 100644 --- a/src/jquery-ui-timepicker-addon.js +++ b/src/jquery-ui-timepicker-addon.js @@ -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 |