% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/validate.R
\name{validate_dates}
\alias{validate_dates}
\title{Validate and Coerce Date Range Arguments}
\usage{
validate_dates(start_date, end_date, use_default_range = FALSE)
}
\arguments{
\item{start_date}{A scalar coercible to \code{Date} via \code{as.Date()}, or \code{NULL}.}

\item{end_date}{A scalar coercible to \code{Date} via \code{as.Date()}, or \code{NULL}.}

\item{use_default_range}{A logical scalar. If \code{TRUE} and both date arguments
are \code{NULL}, a default one-year range is used instead of returning
\code{NULL}. Defaults to \code{FALSE}.}
}
\value{
A named list with elements \code{start_date} and \code{end_date}, both of
class \code{Date} (or \code{NULL} when no dates are provided and
\code{use_default_range = FALSE}).
}
\description{
Checks that \code{start_date} and \code{end_date} are a valid pair, coerces them to
\code{Date}, and handles the case where both are \code{NULL}. When both are \code{NULL} and
\code{use_default_range = TRUE}, a two-year default window ending one year ago is
applied and reported to the user.
}
\seealso{
Other utility functions: 
\code{\link{create_summary_statistics}()},
\code{\link{get_available_huggingface_files}()},
\code{\link{list_supported_indexes}()},
\code{\link{list_supported_types}()},
\code{\link{list_supported_types_ff}()},
\code{\link{list_supported_types_ff_legacy}()},
\code{\link{list_supported_types_macro_predictors}()},
\code{\link{list_supported_types_other}()},
\code{\link{list_supported_types_wrds}()},
\code{\link{list_tidy_finance_chapters}()},
\code{\link{open_tidy_finance_website}()},
\code{\link{trim}()},
\code{\link{winsorize}()}
}
\concept{utility functions}
