Skip to content

Commit

Permalink
Merge pull request #525 from timgoodman/master
Browse files Browse the repository at this point in the history
[Fix #517] `day<-`, `minute<-`, etc. should not produce an error when…
  • Loading branch information
vspinu authored Mar 9, 2017
2 parents c5ddda2 + 7e4b209 commit 332cd13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
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

0 comments on commit 332cd13

Please sign in to comment.