Debian Codegraph @

man/dateInput.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/input-date.R
3 \name{dateInput}
4 \alias{dateInput}
5 \title{Create date input}
6 \usage{
7 dateInput(
8 inputId,
9 label,
10 value = NULL,
11 min = NULL,
12 max = NULL,
13 format = "yyyy-mm-dd",
14 startview = "month",
15 weekstart = 0,
16 language = "en",
17 width = NULL,
18 autoclose = TRUE,
19 datesdisabled = NULL,
20 daysofweekdisabled = NULL
21 )
22 }
23 \arguments{
24 \item{inputId}{The \code{input} slot that will be used to access the value.}
25
26 \item{label}{Display label for the control, or \code{NULL} for no label.}
27
28 \item{value}{The starting date. Either a Date object, or a string in
29 \code{yyyy-mm-dd} format. If NULL (the default), will use the current date
30 in the client's time zone.}
31
32 \item{min}{The minimum allowed date. Either a Date object, or a string in
33 \code{yyyy-mm-dd} format.}
34
35 \item{max}{The maximum allowed date. Either a Date object, or a string in
36 \code{yyyy-mm-dd} format.}
37
38 \item{format}{The format of the date to display in the browser. Defaults to
39 \code{"yyyy-mm-dd"}.}
40
41 \item{startview}{The date range shown when the input object is first clicked.
42 Can be "month" (the default), "year", or "decade".}
43
44 \item{weekstart}{Which day is the start of the week. Should be an integer
45 from 0 (Sunday) to 6 (Saturday).}
46
47 \item{language}{The language used for month and day names. Default is "en".
48 Other valid values include "ar", "az", "bg", "bs", "ca", "cs", "cy", "da",
49 "de", "el", "en-AU", "en-GB", "eo", "es", "et", "eu", "fa", "fi", "fo",
50 "fr-CH", "fr", "gl", "he", "hr", "hu", "hy", "id", "is", "it-CH", "it",
51 "ja", "ka", "kh", "kk", "ko", "kr", "lt", "lv", "me", "mk", "mn", "ms",
52 "nb", "nl-BE", "nl", "no", "pl", "pt-BR", "pt", "ro", "rs-latin", "rs",
53 "ru", "sk", "sl", "sq", "sr-latin", "sr", "sv", "sw", "th", "tr", "uk",
54 "vi", "zh-CN", and "zh-TW".}
55
56 \item{width}{The width of the input, e.g. \code{'400px'}, or \code{'100\%'};
57 see \code{\link[=validateCssUnit]{validateCssUnit()}}.}
58
59 \item{autoclose}{Whether or not to close the datepicker immediately when a
60 date is selected.}
61
62 \item{datesdisabled}{Which dates should be disabled. Either a Date object,
63 or a string in \code{yyyy-mm-dd} format.}
64
65 \item{daysofweekdisabled}{Days of the week that should be disabled. Should be
66 a integer vector with values from 0 (Sunday) to 6 (Saturday).}
67 }
68 \description{
69 Creates a text input which, when clicked on, brings up a calendar that
70 the user can click on to select dates.
71 }
72 \details{
73 The date \code{format} string specifies how the date will be displayed in
74 the browser. It allows the following values:
75
76 \itemize{
77 \item \code{yy} Year without century (12)
78 \item \code{yyyy} Year with century (2012)
79 \item \code{mm} Month number, with leading zero (01-12)
80 \item \code{m} Month number, without leading zero (1-12)
81 \item \code{M} Abbreviated month name
82 \item \code{MM} Full month name
83 \item \code{dd} Day of month with leading zero
84 \item \code{d} Day of month without leading zero
85 \item \code{D} Abbreviated weekday name
86 \item \code{DD} Full weekday name
87 }
88 }
89 \section{Server value}{
90
91 A \link{Date} vector of length 1.
92 }
93
94 \examples{
95 ## Only run examples in interactive R sessions
96 if (interactive()) {
97
98 ui <- fluidPage(
99 dateInput("date1", "Date:", value = "2012-02-29"),
100
101 # Default value is the date in client's time zone
102 dateInput("date2", "Date:"),
103
104 # value is always yyyy-mm-dd, even if the display format is different
105 dateInput("date3", "Date:", value = "2012-02-29", format = "mm/dd/yy"),
106
107 # Pass in a Date object
108 dateInput("date4", "Date:", value = Sys.Date()-10),
109
110 # Use different language and different first day of week
111 dateInput("date5", "Date:",
112 language = "ru",
113 weekstart = 1),
114
115 # Start with decade view instead of default month view
116 dateInput("date6", "Date:",
117 startview = "decade"),
118
119 # Disable Mondays and Tuesdays.
120 dateInput("date7", "Date:", daysofweekdisabled = c(1,2)),
121
122 # Disable specific dates.
123 dateInput("date8", "Date:", value = "2012-02-29",
124 datesdisabled = c("2012-03-01", "2012-03-02"))
125 )
126
127 shinyApp(ui, server = function(input, output) { })
128 }
129
130 }
131 \seealso{
132 \code{\link[=dateRangeInput]{dateRangeInput()}}, \code{\link[=updateDateInput]{updateDateInput()}}
133
134 Other input elements:
135 \code{\link{actionButton}()},
136 \code{\link{checkboxGroupInput}()},
137 \code{\link{checkboxInput}()},
138 \code{\link{dateRangeInput}()},
139 \code{\link{fileInput}()},
140 \code{\link{numericInput}()},
141 \code{\link{passwordInput}()},
142 \code{\link{radioButtons}()},
143 \code{\link{selectInput}()},
144 \code{\link{sliderInput}()},
145 \code{\link{submitButton}()},
146 \code{\link{textAreaInput}()},
147 \code{\link{textInput}()},
148 \code{\link{varSelectInput}()}
149 }
150 \concept{input elements}