Skip to contents

Enforces the convention that the forecast_date itself is day 0 of the forecast horizon, not (e.g. day 1).

Usage

get_last_target_date(forecast_date, forecast_horizon)

Arguments

forecast_date

Forecast date, coercible by as.Date().

forecast_horizon

Forecast horizon, in days.

Value

The last target date, i.e. the last date for which the model will produce a forecast.

Examples

get_last_target_date("2026-01-01", 3)
#> [1] "2026-01-04"
get_last_target_date("2026-01-01", 0)
#> [1] "2026-01-01"