airDatepicker: Air Date Picker Input

Description Usage Arguments Value Note See Also Examples

Description

An alternative to dateInput to select single, multiple or date range. And two alias to select months or years.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
airDatepickerInput(inputId, label = NULL, value = NULL,
  multiple = FALSE, range = FALSE, timepicker = FALSE,
  separator = " - ", placeholder = NULL, dateFormat = "yyyy-mm-dd",
  minDate = NULL, maxDate = NULL, disabledDates = NULL,
  view = c("days", "months", "years"), minView = c("days", "months",
  "years"), monthsField = c("monthsShort", "months"),
  clearButton = FALSE, todayButton = FALSE, autoClose = FALSE,
  timepickerOpts = timepickerOptions(), position = NULL,
  update_on = c("change", "close"), addon = c("right", "left", "none"),
  language = "en", inline = FALSE, 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

inputId

The input slot that will be used to access the value.

label

Display label for the control, or NULL for no label.

value

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

multiple

Select multiple dates.

range

Select a date range.

timepicker

Add a timepicker below calendar to select time.

separator

Separator between dates when several are selected, default to " - ".

placeholder

A character string giving the user a hint as to what can be entered into the control.

dateFormat

Format to use to display date(s), default to "yyyy-mm-dd"

minDate

The minimum allowed date. Either a Date object, or a string in yyyy-mm-dd format.

maxDate

The maximum allowed date. Either a Date object, or a string in yyyy-mm-dd format.

disabledDates

A vector of dates to disable, e.g. won't be able to select one of dates passed.

view

Starting view, one of 'days' (default), 'months' or 'years'.

minView

Minimal view, one of 'days' (default), 'months' or 'years'.

monthsField

Names for the months when view is 'months', use 'monthsShort' for abbreviations or 'months' for full names.

clearButton

If TRUE, then button "Clear" will be visible.

todayButton

If TRUE, then button "Today" will be visible.

autoClose

If TRUE, then after date selection, datepicker will be closed.

timepickerOpts

Options for timepicker, see timepickerOptions.

position

Where calendar should appear, a two word string like 'bottom left' (default), or 'top right', 'left top'.

update_on

When to send selected value to server: on 'change' or when calendar is 'close'd.

addon

Display a calendar icon to 'right' or the 'left' of the widget, or 'none'. This icon act likes an actionButton, you can retrieve value server-side with input$<inputId>_button.

language

Language to use, can be one of 'cs', 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'nl', 'pl', 'pt-BR', \code'pt', 'ro', 'ru', 'sk', 'zh'.

inline

If TRUE, datepicker will always be visible.

width

The width of the input, e.g. '400px', or '100%'.

dateTimeSeparator

Separator between date and time, default to " ".

timeFormat

Desirable time format. You can use h (hours), hh (hours with leading zero), i (minutes), ii (minutes with leading zero), aa (day period - 'am' or 'pm'), AA (day period capitalized)

minHours

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

maxHours

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

minMinutes

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

maxMinutes

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

hoursStep

Hours step in slider.

minutesStep

Minutes step in slider.

...

Arguments passed to airDatepickerInput.

Value

a Date object or a POSIXct in UTC timezone.

Note

This widget prevents dateInput from working, don't use both !

See Also

See updateAirDateInput for updating slider value server-side. And demoAirDatepicker for examples.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## Not run: 

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)

}


## End(Not run)

dreamRs/shinyWidgets documentation built on June 5, 2019, 4:07 a.m.