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

make_date and make_datetime not consistant for out of range values #855

Open
brunj7 opened this issue Jan 31, 2020 · 2 comments
Open

make_date and make_datetime not consistant for out of range values #855

brunj7 opened this issue Jan 31, 2020 · 2 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@brunj7
Copy link
Contributor

brunj7 commented Jan 31, 2020

related to #839

make_date and make_datetime are not consistent when out of range values are passed as parameters. make_date will generate NA, make_datetime will rollover silently

library(lubridate)
#> 
#> Attaching package: 'lubridate'
#> The following object is masked from 'package:base':
#> 
#>     date
make_datetime(2013, 2, 40)
#> [1] "2013-03-12 UTC"
make_date(2013, 2, 40)
#> [1] NA

Created on 2020-01-31 by the reprex package (v0.3.0.9001)

@Kodiologist
Copy link

Worse than the fact that they're inconsistent is that both are fail-silent.

@vspinu vspinu added the bug an unexpected problem or unintended behavior label Mar 7, 2020
@DanChaltiel
Copy link

This is actually a very useful feature to have a rollover, but it is surprising at first and you cannot disable it.
IMHO, there should be a rollover=TRUE parameter to opt-in in both functions.

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

4 participants