Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upwrong 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
lubridateand found a bug related toceiling_datewhen theunit = "week". It should return a date object instead of a datetime.Here's the reproducible example: