Debian Codegraph @

man/updateDateInput.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/update-input.R
3 \name{updateDateInput}
4 \alias{updateDateInput}
5 \title{Change the value of a date input on the client}
6 \usage{
7 updateDateInput(
8 session = getDefaultReactiveDomain(),
9 inputId,
10 label = NULL,
11 value = NULL,
12 min = NULL,
13 max = NULL
14 )
15 }
16 \arguments{
17 \item{session}{The \code{session} object passed to function given to
18 \code{shinyServer}. Default is \code{getDefaultReactiveDomain()}.}
19
20 \item{inputId}{The id of the input object.}
21
22 \item{label}{The label to set for the input object.}
23
24 \item{value}{The starting date. Either a Date object, or a string in
25 \code{yyyy-mm-dd} format. If NULL (the default), will use the current date
26 in the client's time zone.}
27
28 \item{min}{The minimum allowed date. Either a Date object, or a string in
29 \code{yyyy-mm-dd} format.}
30
31 \item{max}{The maximum allowed date. Either a Date object, or a string in
32 \code{yyyy-mm-dd} format.}
33 }
34 \description{
35 Change the value of a date input on the client
36 }
37 \details{
38 The input updater functions send a message to the client, telling it to
39 change the settings of an input object. The messages are collected and sent
40 after all the observers (including outputs) have finished running.
41
42 The syntax of these functions is similar to the functions that created the
43 inputs in the first place. For example, \code{\link{numericInput}()} and
44 \code{updateNumericInput()} take a similar set of arguments.
45
46 Any arguments with NULL values will be ignored; they will not result in any
47 changes to the input object on the client.
48
49 For \code{\link{radioButtons}()}, \code{\link{checkboxGroupInput}()} and
50 \code{\link{selectInput}()}, the set of choices can be cleared by using
51 \code{choices=character(0)}. Similarly, for these inputs, the selected item
52 can be cleared by using \code{selected=character(0)}.
53 }
54 \examples{
55 ## Only run examples in interactive R sessions
56 if (interactive()) {
57
58 ui <- fluidPage(
59 sliderInput("n", "Day of month", 1, 30, 10),
60 dateInput("inDate", "Input date")
61 )
62
63 server <- function(input, output, session) {
64 observe({
65 date <- as.Date(paste0("2013-04-", input$n))
66 updateDateInput(session, "inDate",
67 label = paste("Date label", input$n),
68 value = date,
69 min = date - 3,
70 max = date + 3
71 )
72 })
73 }
74
75 shinyApp(ui, server)
76 }
77 }
78 \seealso{
79 \code{\link[=dateInput]{dateInput()}}
80 }