% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/input-airDatepicker.R
\name{airDatepicker}
\alias{airDatepicker}
\alias{airDatepickerInput}
\alias{timepickerOptions}
\alias{airMonthpickerInput}
\alias{airYearpickerInput}
\title{Air Date Picker Input}
\usage{
airDatepickerInput(
  inputId,
  label = NULL,
  value = NULL,
  multiple = FALSE,
  range = FALSE,
  timepicker = FALSE,
  separator = " - ",
  placeholder = NULL,
  dateFormat = "yyyy-MM-dd",
  firstDay = NULL,
  minDate = NULL,
  maxDate = NULL,
  disabledDates = NULL,
  disabledDaysOfWeek = NULL,
  highlightedDates = NULL,
  view = c("days", "months", "years"),
  startView = NULL,
  minView = c("days", "months", "years"),
  monthsField = c("monthsShort", "months"),
  clearButton = FALSE,
  todayButton = FALSE,
  autoClose = FALSE,
  timepickerOpts = timepickerOptions(),
  position = NULL,
  update_on = c("change", "close"),
  onlyTimepicker = FALSE,
  toggleSelected = TRUE,
  addon = c("right", "left", "none"),
  addonAttributes = list(class = "btn-outline-secondary"),
  language = "en",
  tz = NULL,
  inline = FALSE,
  readonly = FALSE,
  onkeydown = NULL,
  width = NULL
)

timepickerOptions(
  dateTimeSeparator = NULL,
  timeFormat = NULL,
  minHours = NULL,
  maxHours = NULL,
  minMinutes = NULL,
  maxMinutes = NULL,
  hoursStep = NULL,
  minutesStep = NULL
)

airMonthpickerInput(inputId, label = NULL, value = NULL, ...)

airYearpickerInput(inputId, label = NULL, value = NULL, ...)
}
\arguments{
\item{inputId}{The \code{input} slot that will be used to access the value.}

\item{label}{Display label for the control, or \code{NULL} for no label.}

\item{value}{Initial value(s), dates as character string are accepted in \code{yyyy-mm-dd} format,
or Date/POSIXct object. Can be a single value or several values.}

\item{multiple}{Select multiple dates. If \code{TRUE}, then one can select unlimited dates.
If \code{numeric} is passed, then amount of selected dates will be limited by it.}

\item{range}{Select a date range.}

\item{timepicker}{Add a timepicker below calendar to select time.}

\item{separator}{Separator between dates when several are selected, default to \code{" - "}.}

\item{placeholder}{A character string giving the user a hint as to what can be entered into the control.}

\item{dateFormat}{Format to use to display date(s), default to \code{yyyy-MM-dd},
see \href{https://air-datepicker.com/docs?scrollTo=dateFormat}{online documentation} for possible values.}

\item{firstDay}{Day index from which week will be started. Possible values are from 0 to 6, where
0 - Sunday and 6 - Saturday. By default value is taken from current localization,
but if it passed here then it will have higher priority.}

\item{minDate}{The minimum allowed date. Either a Date object, or a string in \code{yyyy-mm-dd} format.}

\item{maxDate}{The maximum allowed date. Either a Date object, or a string in \code{yyyy-mm-dd} format.}

\item{disabledDates}{A vector of dates to disable, e.g. won't be able to select one of dates passed.}

\item{disabledDaysOfWeek}{Day(s) of week to disable, numbers from 0 (Sunday) to 6 (Saturday).}

\item{highlightedDates}{A vector of dates to highlight.}

\item{view}{Starting view, one of \code{'days'} (default), \code{'months'} or \code{'years'}.}

\item{startView}{Date shown in calendar when date picker is opened.}

\item{minView}{Minimal view, one of \code{'days'} (default), \code{'months'} or \code{'years'}.}

\item{monthsField}{Names for the months when view is 'months',
use \code{'monthsShort'} for abbreviations or \code{'months'} for full names.}

\item{clearButton}{If \code{TRUE}, then button "Clear" will be visible.}

\item{todayButton}{If \code{TRUE}, then button "Today" will be visible to set view to current date,
if a \code{Date} is used, it will set view to the given date and select it..}

\item{autoClose}{If \code{TRUE}, then after date selection, datepicker will be closed.}

\item{timepickerOpts}{Options for timepicker, see \code{\link[=timepickerOptions]{timepickerOptions()}}.}

\item{position}{Where calendar should appear, a two word string like
\code{'bottom left'} (default), or \code{'top right'}, \code{'left top'}.}

\item{update_on}{When to send selected value to server: on \code{'change'}
or when calendar is \code{'close'}d.}

\item{onlyTimepicker}{Display only the time picker.}

\item{toggleSelected}{When \code{TRUE}, in range mode, it's not possible to select the same date as start and end.}

\item{addon}{Display a calendar icon to \code{'right'} or the \code{'left'}
of the widget, or \code{'none'}. This icon act like an \code{\link[shiny:actionButton]{shiny::actionButton()}},
you can retrieve value server-side with \verb{input$<inputId>_button}.}

\item{addonAttributes}{A \code{list()} of additional attributes to use for the addon tag, like \code{class} for example.}

\item{language}{Language to use, can be one of
\code{ar}, \code{cs}, \code{da}, \code{de}, \code{en}, \code{es}, \code{fi}, \code{fr}, \code{hu}, \code{it}, \code{ja}, \code{ko}, \code{nl},
\code{pl}, \code{pt-BR}, \code{pt}, \code{ro}, \code{ru}, \code{si}, \code{sk}, \code{sv}, \code{th}, \code{tr}, \code{uk}, \code{zh}.}

\item{tz}{The timezone.}

\item{inline}{If \code{TRUE}, datepicker will always be visible.}

\item{readonly}{If \code{TRUE}, datepicker will be readonly and the input field won't be editable.}

\item{onkeydown}{Attribute passed to the input field.}

\item{width}{The width of the input, e.g. \code{'400px'}, or \verb{100\%}.}

\item{dateTimeSeparator}{Separator between date and time, default to \code{" "}.}

\item{timeFormat}{Desirable time format. You can use:
\itemize{
\item \code{h} — hours in 12-hour mode
\item \code{hh} — hours in 12-hour mode with leading zero
\item \code{H} — hours in 24-hour mode
\item \code{HH} — hours in 24-hour mode with leading zero
\item \code{m} — minutes
\item \code{mm} — minutes with leading zero
\item \code{aa} — day period lower case
\item \code{AA} — day period upper case
}}

\item{minHours}{Minimal hours value, must be between 0 and 23. You will not be able to choose value lower than this.}

\item{maxHours}{Maximum hours value, must be between 0 and 23. You will not be able to choose value higher than this.}

\item{minMinutes}{Minimal minutes value, must be between 0 and 59. You will not be able to choose value lower than this.}

\item{maxMinutes}{Maximum minutes value, must be between 0 and 59. You will not be able to choose value higher than this.}

\item{hoursStep}{Hours step in slider.}

\item{minutesStep}{Minutes step in slider.}

\item{...}{Arguments passed to \code{airDatepickerInput}.}
}
\value{
a \code{Date} object or a \code{POSIXct} in UTC timezone.
}
\description{
An alternative to \code{\link[shiny:dateInput]{shiny::dateInput()}} to select single, multiple or date range
based on \href{https://air-datepicker.com/}{Air Datepicker library}.
And two alias to select months or years.
}
\note{
Since shinyWidgets 0.5.2 there's no more conflicts with \code{\link[shiny:dateInput]{shiny::dateInput()}}.
}
\examples{
if (interactive()) {

# examples of different options to select dates:
demoAirDatepicker("datepicker")

# select month(s)
demoAirDatepicker("months")

# select year(s)
demoAirDatepicker("years")

# select date and time
demoAirDatepicker("timepicker")

# You can select multiple dates :
library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  airDatepickerInput(
    inputId = "multiple",
    label = "Select multiple dates:",
    placeholder = "You can pick 5 dates",
    multiple = 5, clearButton = TRUE
  ),
  verbatimTextOutput("res")
)

server <- function(input, output, session) {
  output$res <- renderPrint(input$multiple)
}

shinyApp(ui, server)

}
}
\seealso{
\itemize{
\item \code{\link[=demoAirDatepicker]{demoAirDatepicker()}} for demo apps
\item \code{\link[=updateAirDateInput]{updateAirDateInput()}} for updating from server
}
}
