sobhagya-sahu / datejs

Automatically exported from code.google.com/p/datejs
0 stars 0 forks source link

AddHours stops on Sunday at 00:00 #120

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a new date 
2. call addHours(1) until you get to next sunday

What is the expected output? What do you see instead?
The date object method addMilliseconds calls getMilliseconds that for some 
reason returns 0. So the time does not get increased

What version of the product are you using? On what operating system?
1.0 Alpha-1

Please provide any additional information below.

I've changed the method code from

$P.addHours = function (value) { 
        return this.addMilliseconds(value * 3600000); /* 60*60*1000 */
};

to 

$P.addHours=function(value){
  this.setTime(
     this.getTime() + (h*60*60*1000)
  );
  return this;
} 

Original issue reported on code.google.com by andrea.s...@gmail.com on 28 Mar 2011 at 11:04

GoogleCodeExporter commented 8 years ago
works fine in the current build on my fork: 
https://github.com/abritinthebay/datejs/

Original comment by gwildsm...@bleacherreport.com on 17 Sep 2013 at 9:47