summaryrefslogtreecommitdiffstats
path: root/jquery-ui-timepicker-addon.js
diff options
context:
space:
mode:
authorStephen Vance <steve@vance.com>2013-07-07 22:21:01 -0400
committerStephen Vance <steve@vance.com>2013-07-07 22:21:01 -0400
commit83b68407dccb9df36893df2b05692bda96d79dae (patch)
tree8d1e60397cc4d303718ef8ee1f301ee71fca9914 /jquery-ui-timepicker-addon.js
parent34e2ee285c1d5d79d6be3b85193176b6efd95905 (diff)
downloadjQuery-Timepicker-Addon-83b68407dccb9df36893df2b05692bda96d79dae.zip
jQuery-Timepicker-Addon-83b68407dccb9df36893df2b05692bda96d79dae.tar.gz
jQuery-Timepicker-Addon-83b68407dccb9df36893df2b05692bda96d79dae.tar.bz2
Start tests for timepicker functions. Test timezoneOffsetNumber() and fix seeming deviation from intent, although not in a likely meaningful way.
Diffstat (limited to 'jquery-ui-timepicker-addon.js')
-rw-r--r--jquery-ui-timepicker-addon.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js
index 38074f1..eb18303 100644
--- a/jquery-ui-timepicker-addon.js
+++ b/jquery-ui-timepicker-addon.js
@@ -1942,19 +1942,19 @@
* @return {number}
*/
$.timepicker.timezoneOffsetNumber = function(tzString) {
- tzString = tzString.toString().replace(':',''); // excuse any iso8601, end up with "+1245"
+ var normalized = tzString.toString().replace(':',''); // excuse any iso8601, end up with "+1245"
- if(tzString.toUpperCase() === 'Z'){ // if iso8601 with Z, its 0 minute offset
+ if(normalized.toUpperCase() === 'Z'){ // if iso8601 with Z, its 0 minute offset
return 0;
}
- if(!/^(\-|\+)\d{4}$/.test(tzString)){ // possibly a user defined tz, so just give it back
+ if(!/^(\-|\+)\d{4}$/.test(normalized)){ // possibly a user defined tz, so just give it back
return tzString;
}
- return ((tzString.substr(0,1) =='-'? -1 : 1) * // plus or minus
- ((parseInt(tzString.substr(1,2),10)*60) + // hours (converted to minutes)
- parseInt(tzString.substr(3,2),10))); // minutes
+ 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
};
/**