View source: R/twDateRangeInput.R
twDateRangeInput | R Documentation |
shiny::dateRangeInput()
but allowing for more classesWrapper around shiny::dateRangeInput()
but allowing for more classes
twDateRangeInput( inputId, label, start = NULL, end = NULL, min = NULL, max = NULL, format = "yyyy-mm-dd", startview = "month", weekstart = 0, language = "en", separator = " to ", width = NULL, autoclose = TRUE, container_class = NULL, label_class = NULL, input_class = NULL, sep_class = NULL, label_after_input = FALSE )
inputId |
The |
label |
Display label for the control, or |
start |
The initial start date. Either a Date object, or a string in
|
end |
The initial end date. Either a Date object, or a string in
|
min |
The minimum allowed date. Either a Date object, or a string in
|
max |
The maximum allowed date. Either a Date object, or a string in
|
format |
The format of the date to display in the browser. Defaults to
|
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). |
language |
The language used for month and day names. Default is "en". Other valid values include "ar", "az", "bg", "bs", "ca", "cs", "cy", "da", "de", "el", "en-AU", "en-GB", "eo", "es", "et", "eu", "fa", "fi", "fo", "fr-CH", "fr", "gl", "he", "hr", "hu", "hy", "id", "is", "it-CH", "it", "ja", "ka", "kh", "kk", "ko", "kr", "lt", "lv", "me", "mk", "mn", "ms", "nb", "nl-BE", "nl", "no", "pl", "pt-BR", "pt", "ro", "rs-latin", "rs", "ru", "sk", "sl", "sq", "sr-latin", "sr", "sv", "sw", "th", "tr", "uk", "vi", "zh-CN", and "zh-TW". |
separator |
String to display between the start and end input boxes. |
width |
The width of the input, e.g. |
autoclose |
Whether or not to close the datepicker immediately when a date is selected. |
container_class |
additional classes to be applied to the container |
label_class |
additional classes to be applied to the label |
input_class |
additional classes to be applied to the input element |
sep_class |
additional classes to be applied to the separator element |
label_after_input |
TRUE/FALSE if the label should be put after the input box. Default is FALSE. Useful for special cases (floating labels), c.f. 04-shiny-inputs example app. |
a list with a shiny.tag
class
shiny::dateRangeInput()
shiny::dateRangeInput("date", "A Date") twDateRangeInput( "date", "A Date Range", container_class = "CONTAINER", label_class = "LABEL", input_class = "INPUT", sep_class = "SEP" ) # basic full shiny example library(shiny) ui <- fluidPage( use_tailwind(), twDateRangeInput( "date", "A Date", # Apply tailwind classes container_class = "w-48 m-4 p-2 border border-gray-200 rounded-md drop-shadow-md", label_class = "font-mono text-gray-600", input_class = "drop-shadow-lg text-gray-600 font-mono rounded-md border-amber-400", sep_class = "bg-amber-600 text-white font-bold font-mono" ), verbatimTextOutput("value") ) server <- function(input, output) { output$value <- renderText({ as.character(input$date) }) } if (interactive()) shiny::shinyApp(ui, server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.