Skip to content

Commit

Permalink
Fix bug in financial_years
Browse files Browse the repository at this point in the history
  • Loading branch information
izaak-jephson committed Aug 14, 2024
1 parent 952cf9d commit 94b6457
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/date_tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ convert_col_date <- function(data, input_format = "%Y-%m",output_format = "%B %Y

financial_year <- function(date, fin_year_start_day = 1, fin_year_start_month = 4){
dplyr::case_when(lubridate::month(date) + lubridate::day(date) <
fin_year_start_month + 0.01 * fin_year_start_day) ~
paste0(lubridate::year(date) - 1, "-", lubridate::year(date))
.default = (paste0(lubridate::year(date), "-", lubridate::year(date) + 1))
fin_year_start_month + 0.01 * fin_year_start_day ~
paste0(lubridate::year(date) - 1, "-", lubridate::year(date)),
.default = paste0(lubridate::year(date), "-", lubridate::year(date) + 1))
}

#' Create standard calendar with Scottish bank holidays
Expand Down
19 changes: 19 additions & 0 deletions vignettes/qa_tables.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: "qa_tables"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{qa_tables}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

```{r setup}
library(sssstats)
```

0 comments on commit 94b6457

Please sign in to comment.