-
Notifications
You must be signed in to change notification settings - Fork 210
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
wrong return type in ceiling_date
when unit = "week"
#479
Comments
I've filed a PR. |
Why do you think so? If it returns date for week, shouldn't it return date for "day", "month" and "year" as well? |
It's true that day month and year returns a date. Isn't it? |
@vspinu Here's is what's returned in ceiling_date(ymd("20160927"), "year")
## [1] "2017-01-01"
ceiling_date(ymd("20160927"), "month")
## [1] "2016-10-01"
ceiling_date(ymd("20160927"), "week")
## [1] "2016-10-02 08:00:00 CST"
ceiling_date(ymd("20160927"), "day")
## [1] "2016-09-28" |
Yes. You are right. I got confused for a second due to recent re-designing of rounding API. |
1. Closes tidyverse#479 2. add news and test
It's a very powerful and useful package. Certainly it takes lots of effort to improve. 🍺 |
1. Closes tidyverse#479 2. add news and test
Seems like this issue is alive again in
|
It is ok in current development version of lubridate 1.6.0.9009. library(lubridate)
ceiling_date(ymd("20160927"), "year")
#> [1] "2017-01-01"
ceiling_date(ymd("20160927"), "month")
#> [1] "2016-10-01"
ceiling_date(ymd("20160927"), "week")
#> [1] "2016-10-02"
ceiling_date(ymd("20160927"), "day")
#> [1] "2016-09-28" |
Hi, @vspinu, I tried the CRAN version of
lubridate
and found a bug related toceiling_date
when theunit = "week"
. It should return a date object instead of a datetime.Here's the reproducible example:
The text was updated successfully, but these errors were encountered: