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

Lubridate jumps over a month #336

Closed
adeldaoud opened this issue Jul 28, 2015 · 1 comment
Closed

Lubridate jumps over a month #336

adeldaoud opened this issue Jul 28, 2015 · 1 comment
Labels
bug an unexpected problem or unintended behavior

Comments

@adeldaoud
Copy link

Lubridate jumps over the 3ed month here:

as.period(interval(ymd("1985-12-31"),ymd("1986-01-01")))%/%months(1)
as.period(interval(ymd("1985-12-31"),ymd("1986-02-01")))%/%months(1)
as.period(interval(ymd("1985-12-31"),ymd("1986-03-01")))%/%months(1)
as.period(interval(ymd("1985-12-31"),ymd("1986-04-01")))%/%months(1)
as.period(interval(ymd("1985-12-31"),ymd("1986-05-01")))%/%months(1)

This seems to be a bug, or at least an unexpected calculation.

@vspinu
Copy link
Member

vspinu commented Jul 28, 2015

The problem is with the

> as.period(interval(ymd("1985-12-31"),ymd("1986-03-01")))
[1] "2m -2d 0H 0M 0S"

There should be no negative days in as.period conversion.

@vspinu vspinu added the bug an unexpected problem or unintended behavior label Jul 28, 2015
@vspinu vspinu closed this as completed in 0bbe8c1 Sep 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants