% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/01_chronon_parse.R
\name{chronon_parse_linear}
\alias{chronon_parse_linear}
\alias{chronon_parse_cyclical}
\title{Default parsing format strings for chronons}
\usage{
chronon_parse_linear(x, cal = time_calendar(x), ...)

chronon_parse_cyclical(x, y, ...)
}
\arguments{
\item{x}{A time granule for the chronon.}

\item{cal}{The calendar of the chronon, used to disambiguate suitable format
strings for time units that are shared across calendars (e.g.
\code{cal_gregorian$day} and \code{cal_isoweek$day}).}

\item{...}{Additional arguments for methods.}

\item{y}{A time granule for the cycle}
}
\value{
A character vector of format templates, ordered from most to
least common, built with \code{\link[=parse_format]{parse_format()}}. The first element typically
matches \code{\link[=chronon_format_linear]{chronon_format_linear()}} (for \code{chronon_parse_linear()}) or
\code{\link[=chronon_format_cyclical]{chronon_format_cyclical()}} (for \code{chronon_parse_cyclical()}) for the
same chronon.
}
\description{
Provides candidate format strings for parsing text into a given chronon
(finest time granule), for use as the \code{format} argument of
\code{\link[=time_parse]{time_parse()}}. Dispatches the same way as
\code{\link[=chronon_format_linear]{chronon_format_linear()}}/\code{\link[=chronon_format_cyclical]{chronon_format_cyclical()}}, but returns every
common format instead of a single default, so \code{\link[=time_parse]{time_parse()}} can try each
in turn and keep whichever parses the most values. Methods should build
their return value with \code{\link[=parse_format]{parse_format()}}.
}
\examples{
chronon_parse_linear(cal_gregorian$year(1L))
chronon_parse_linear(cal_gregorian$month(1L))
chronon_parse_linear(cal_gregorian$day(1L))
chronon_parse_linear(cal_isoweek$day(1L))

chronon_parse_cyclical(cal_gregorian$month(1L), cal_gregorian$year(1L))
chronon_parse_cyclical(cal_isoweek$day(1L), cal_isoweek$week(1L))

}
\seealso{
\code{\link[=parse_format]{parse_format()}} for building candidate format strings (what
these methods are built from), \code{\link[=time_parse]{time_parse()}} for using the result as
candidate formats, \code{\link[=chronon_format_linear]{chronon_format_linear()}}/\code{\link[=chronon_format_cyclical]{chronon_format_cyclical()}}
for the single default format these are based on.
}
