captbaritone / captbaritone/datejs

AddHours stops on Sunday at 00:00

Open
#120 0 comments 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
JavaScript
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.