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

Comments

@adeldaoud
Copy link

@adeldaoud adeldaoud commented Jul 28, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants