% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/date_check.R
\name{date_check}
\alias{date_check}
\title{Check Date Values}
\usage{
date_check(
  data,
  variable,
  min_date = NULL,
  max_date = NULL,
  allow_future = TRUE
)
}
\arguments{
\item{data}{A data.frame.}

\item{variable}{A single character string specifying the
Date or POSIXct variable to check.}

\item{min_date}{Optional minimum acceptable date.}

\item{max_date}{Optional maximum acceptable date.}

\item{allow_future}{Logical. If FALSE, dates later than
the current date are flagged. Default is TRUE.}
}
\value{
A data.frame of class \code{DateCheck} containing
row-level date diagnostics.
}
\description{
Checks a Date or POSIXct variable for missing values,
dates outside user-defined limits, and optionally future
dates.
}
\details{
The selected variable must inherit from \code{Date} or
\code{POSIXct}.

Missing values are reported separately and are not
classified as out-of-range dates.

When \code{allow_future = FALSE}, observations later than
the current date are flagged in \code{Future}.

The \code{min_date} and \code{max_date} arguments may be
supplied as Date, POSIXct, or single character strings
in ISO format (\code{YYYY-MM-DD}).
}
\examples{
dat <- data.frame(
  Sample_Date = as.Date(c(
    "2025-01-01",
    "2025-06-01",
    "2026-01-01",
    NA
  ))
)

date_check(
  dat,
  variable = "Sample_Date",
  min_date = "2025-01-01",
  max_date = "2025-12-31"
)

}
