Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong calculation of DateLastMilliOfWeek #49

Closed
dittodhole opened this issue Mar 17, 2011 · 0 comments
Closed

wrong calculation of DateLastMilliOfWeek #49

dittodhole opened this issue Mar 17, 2011 · 0 comments
Assignees

Comments

@dittodhole
Copy link

  _dateLastMilliOfWeek : function(date) {
     var lastDayOfWeek = this._dateLastDayOfWeek(date);
     return new Date(lastDayOfWeek.getTime() + (MILLIS_IN_DAY));

  }

this is wrong:
if we have eg. sunday 00:00 and we want to get monday 00:00, adding 24 hours to sunday 00:00 ain't monday 00:00...

fix:

  _dateLastMilliOfWeek : function(date) {
     var lastDayOfWeek = this._dateLastDayOfWeek(date);
     lastDayOfWeek.setDate(lastDayOfWeek.getDate() + 1);
     return lastDayOfWeek;
  }
@ghost ghost assigned ludovicPelle Apr 22, 2011
ludovicPelle added a commit that referenced this issue Apr 22, 2011
ludovicPelle added a commit that referenced this issue Apr 22, 2011
ludovicPelle added a commit that referenced this issue May 2, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants