Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Aggregation must be done using the local time

  • Loading branch information...
commit 6554e3b62a4f21a84a83560e713d180b54ebb3fc 1 parent df3f932
@fzaninotto fzaninotto authored
Showing with 14 additions and 14 deletions.
  1. +14 −14 lib/timeCalculator.js
View
28 lib/timeCalculator.js
@@ -7,44 +7,44 @@ TimeCalculator.prototype.getDate = function() {
};
TimeCalculator.prototype.resetHour = function() {
- this.date.setUTCMinutes(0);
- this.date.setUTCSeconds(0);
- this.date.setUTCMilliseconds(0);
+ this.date.setMinutes(0);
+ this.date.setSeconds(0);
+ this.date.setMilliseconds(0);
};
TimeCalculator.prototype.completeHour = function() {
- this.date.setUTCMinutes(59);
- this.date.setUTCSeconds(59);
- this.date.setUTCMilliseconds(999);
+ this.date.setMinutes(59);
+ this.date.setSeconds(59);
+ this.date.setMilliseconds(999);
};
TimeCalculator.prototype.resetDay = function() {
this.resetHour();
- this.date.setUTCHours(0);
+ this.date.setHours(0);
};
TimeCalculator.prototype.completeDay = function() {
this.completeHour();
- this.date.setUTCHours(23);
+ this.date.setHours(23);
};
TimeCalculator.prototype.resetMonth = function() {
this.resetDay();
- this.date.setUTCDate(1);
+ this.date.setDate(1);
};
TimeCalculator.prototype.completeMonth = function() {
this.completeDay();
- var currentMonth = this.date.getUTCMonth();
- this.date.setUTCDate(32);
- while (currentMonth < this.date.getUTCMonth()) {
- this.date.setUTCDate(this.date.getUTCDate() - 1);
+ var currentMonth = this.date.getMonth();
+ this.date.setDate(32);
+ while (currentMonth < this.date.getMonth()) {
+ this.date.setDate(this.date.getDate() - 1);
}
};
TimeCalculator.prototype.resetYear = function() {
this.resetMonth();
- this.date.setUTCMonth(0);
+ this.date.setMonth(0);
};
['resetHour', 'completeHour', 'resetDay', 'completeDay', 'resetMonth', 'completeMonth', 'resetYear'].forEach(function(name) {
Please sign in to comment.
Something went wrong with that request. Please try again.