Skip to contents

Return the date of the **Saturday that follows** the forecast date. The `reference_date` is defined for forecast hubs as the Saturday Following the forecast date.

Usage

get_reference_date(forecast_date)

Arguments

forecast_date

A vector of dates to process. Accepts objects coercible to `Date`: `Date`, `POSIXct`, or character strings in unambiguous ISO-like formats (e.g., `"2025-10-13"`). See Details for time-zone notes with `POSIXct`.

Value

A `Date` vector of the same length as `forecast_date`, giving the Saturday on or after `forecast_date`. `NA` inputs yield `NA` outputs.

The function is fully vectorized.

See also

Examples

# Basic usage
get_reference_date("2025-10-13")
#> [1] "2025-10-18"
#> "2025-10-18"

# Input is Saturday: strictly after by default
get_reference_date(as.Date("2025-10-18"))
#> [1] "2025-10-18"
#> "2025-10-25"

# Allow returning the same day if it is Saturday
get_reference_date("2025-10-18")
#> [1] "2025-10-18"
#> "2025-10-18"