diff options
author | Stephen Vance <steve@vance.com> | 2013-07-08 22:00:36 -0400 |
---|---|---|
committer | Stephen Vance <steve@vance.com> | 2013-07-08 22:00:36 -0400 |
commit | 4b343728754a485f258a1308f3de3f22120eb098 (patch) | |
tree | f22db6ce930e1dfb67d8b5a6716b470c80543543 /jquery-ui-timepicker-addon.js | |
parent | 7bc2133a3b589f2fde2d6fe2b0fea658c3109bb0 (diff) | |
download | jQuery-Timepicker-Addon-4b343728754a485f258a1308f3de3f22120eb098.zip jQuery-Timepicker-Addon-4b343728754a485f258a1308f3de3f22120eb098.tar.gz jQuery-Timepicker-Addon-4b343728754a485f258a1308f3de3f22120eb098.tar.bz2 |
Test timepicker.timezoneOffsetString(). Fix lower range issue and simplify formatting of output string by eliminating 'magic' 101 values.
Diffstat (limited to 'jquery-ui-timepicker-addon.js')
-rw-r--r-- | jquery-ui-timepicker-addon.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index d526bed..0b0d2e3 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -1915,12 +1915,12 @@ /** * Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5) - * @param {number} tzMinutes if not a number this value is returned + * @param {number} tzMinutes if not a number, less than -720 (-1200), or greater than 840 (+1400) this value is returned * @param {boolean} iso8601 if true formats in accordance to iso8601 "+12:45" * @return {string} */ $.timepicker.timezoneOffsetString = function(tzMinutes, iso8601) { - if(isNaN(tzMinutes) || tzMinutes > 840){ + if(isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720){ return tzMinutes; } @@ -1928,7 +1928,7 @@ minutes = off % 60, hours = (off - minutes) / 60, iso = iso8601? ':':'', - tz = (off >= 0 ? '+' : '-') + ('0' + (hours * 101).toString()).slice(-2) + iso + ('0' + (minutes * 101).toString()).slice(-2); + tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2); if(tz == '+00:00'){ return 'Z'; |