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

[Fix #517] day<-, minute<-, etc. should not produce an error when… #525

Merged
merged 1 commit into from
Mar 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Version 1.6.0.9000
* [#486](https://github.com/hadley/lubridate/issues/486) ceiling_date handles `NA` properly.
* [#483](https://github.com/hadley/lubridate/pull/483) Fix add_duration_to_date error when duration first element is NA.
* [#524](https://github.com/hadley/lubridate/pull/524) Correctly compute length of period in months (issue #490)
* [#525](https://github.com/hadley/lubridate/pull/525) Fix to prevent `day<-`, `minute<-`, etc. from producing an error when length(x) is 0 (issue #517)

Version 1.6.0
=============
Expand Down
2 changes: 2 additions & 0 deletions R/periods.r
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ parse_period <- function(x){
month = 0, year = 0
)

if (nrow(pieces) == 0) defaults <- defaults[0, ]

pieces <- cbind(pieces, defaults[setdiff(names(defaults), names(pieces))])
## pieces <- pieces[c("year", "month", "week", "day", "hour", "minute", "second")]

Expand Down