dateInputs: Create Tabular Date Inputs

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Create tabular text inputs that, when clicked on, bring up a calendar that the user can click on to select dates.

Usage

 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
dateInput_cell(
  inputId,
  label = "",
  value = NULL,
  min = NULL,
  max = NULL,
  format = "yyyy-mm-dd",
  startview = "month",
  weekstart = 0,
  language = "en",
  width = "",
  emptyValueNoDefault = TRUE,
  disabled = FALSE,
  hidden = FALSE
)

dateInput_row(
  inputId,
  label = "",
  value = NULL,
  min = NULL,
  max = NULL,
  format = "yyyy-mm-dd",
  startview = "month",
  weekstart = 0,
  language = "en",
  width = "",
  leftLabel = TRUE,
  disabled = FALSE,
  hidden = FALSE
)

Arguments

inputId

the input slot that will be used to acces the value

label

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

value

The starting date. Either a date object, or a string in yyyy-mm-dd format. If NULL (the default), will use the current date in the client's time zone.

min

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

max

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

format

The format for the date to display in the browser. Defaults to "yyyy-mm-dd"

startview

The date range shown when the input object is first clicked. Can be "month" (the default), "year", or "decade".

weekstart

Which day is the start of the week. Should be an integer from 0 (Sunday) to 6 (Saturday)

width

The width of the input, eg '400px' or '100%'

The

language used for month and day names. Default is "en". See dateInput for other valid options.

Details

For more about format strings, see the documentation for dateInput

Value

dateInput_cell returns a character vector the length of inputId.

dateInput_row returns a data frame with two columns and a row for every element in inputId

Author(s)

Benjamin Nutter

See Also

dateInput, dateRangeInput

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
## Not run: 
options(pixiedust_print_method = "html")
shinyApp(
  ui = shinyUI(
    navbarPage(title = "Example",
      tabsetPanel(
        tabPanel(title = "Dates",
          uiOutput("sampleUI")
        )
      )
    )
  ),
  
  server = shinyServer(function(input, output){
    output$sampleUI <- 
      renderText({ 
        dateInput_row(inputId = paste0("car", 1:nrow(mtcars)),
                      label = rownames(mtcars)) %>%
        dust() %>%
        print(asis = FALSE)
      })
      
  })
)

## End(Not run)

nutterb/shinydust documentation built on Dec. 6, 2020, 8:13 a.m.