From 5f23d9b5de2ce0bc42bd9c39f20d57514a99bfd9 Mon Sep 17 00:00:00 2001 From: Earo Wang Date: Wed, 24 Jan 2024 13:34:09 +1100 Subject: [PATCH] fixed `vec_ptype2()` for yearweek and yearquarter closes #299 --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ R/yearquarter.R | 2 +- R/yearweek.R | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 044d834e..975842c7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: tsibble Title: Tidy Temporal Data Frames and Tools -Version: 1.1.3 +Version: 1.1.4 Authors@R: c(person(given = "Earo", family = "Wang", diff --git a/NEWS.md b/NEWS.md index eed07351..bc788d48 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# tsibble 1.1.4 + +* Fixed `vec_ptype2()` for `yearweek` and `yearquarter` for non-default week start. (#299) + # tsibble 1.1.3 * Fixed the argument of `.full` in `*_gaps()` when inputs like `T`, `F` are valid. (#275) diff --git a/R/yearquarter.R b/R/yearquarter.R index 7e78c6df..4f96754b 100644 --- a/R/yearquarter.R +++ b/R/yearquarter.R @@ -245,7 +245,7 @@ vec_ptype2.yearquarter.yearquarter <- function(x, y, ...) { if (fiscal_start(x) != fiscal_start(y)) { abort("Can't combine with different `fiscal_start`.") } - new_yearquarter() + new_yearquarter(fiscal_start = fiscal_start(x)) } #' @export diff --git a/R/yearweek.R b/R/yearweek.R index c922e403..02f3c28e 100644 --- a/R/yearweek.R +++ b/R/yearweek.R @@ -227,7 +227,7 @@ vec_ptype2.yearweek.yearweek <- function(x, y, ...) { if (week_start(x) != week_start(y)) { abort("Can't combine with different `week_start`.") } - new_yearweek() + new_yearweek(week_start = week_start(x)) } #' @export