summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent Richardson <trentdrichardson@gmail.com>2013-06-14 07:42:00 -0400
committerTrent Richardson <trentdrichardson@gmail.com>2013-06-14 07:42:00 -0400
commit38b7fdd06bab544b08ddb9c966b4dc1c26a177f0 (patch)
treead704dd988566955daf5b86a8d93cbf724dc89d3
parent1bc6cad4f978f3f3dcf2d604d01ed0b3fb72cfbc (diff)
downloadjQuery-Timepicker-Addon-38b7fdd06bab544b08ddb9c966b4dc1c26a177f0.zip
jQuery-Timepicker-Addon-38b7fdd06bab544b08ddb9c966b4dc1c26a177f0.tar.gz
jQuery-Timepicker-Addon-38b7fdd06bab544b08ddb9c966b4dc1c26a177f0.tar.bz2
Improvements to microsecond prototype for Date
-rw-r--r--jquery-ui-timepicker-addon.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js
index b8c5ae4..dce5265 100644
--- a/jquery-ui-timepicker-addon.js
+++ b/jquery-ui-timepicker-addon.js
@@ -2111,12 +2111,16 @@
};
/*
- * Rough microsecond support
+ * Microsecond support
*/
if(!Date.prototype.getMicroseconds){
- Date.microseconds = 0;
+ Date.prototype.microseconds = 0;
Date.prototype.getMicroseconds = function(){ return this.microseconds; };
- Date.prototype.setMicroseconds = function(m){ this.microseconds = m; return this; };
+ Date.prototype.setMicroseconds = function(m){
+ this.setMilliseconds(this.getMilliseconds() + Math.floor(m/1000);
+ this.microseconds = m%1000;
+ return this;
+ };
}
/*