twDateInput | R Documentation |
shiny::dateInput()
but allowing for more classesWrapper around shiny::dateInput()
but allowing for more classes
twDateInput( inputId, label, value = NULL, min = NULL, max = NULL, format = "yyyy-mm-dd", startview = "month", weekstart = 0, language = "en", width = NULL, autoclose = TRUE, datesdisabled = NULL, daysofweekdisabled = NULL, container_class = NULL, label_class = NULL, input_class = NULL, label_after_input = FALSE )
inputId |
The |
label |
Display label for the control, or |
value |
The starting 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". |
width |
The width of the input, e.g. |
autoclose |
Whether or not to close the datepicker immediately when a date is selected. |
datesdisabled |
Which dates should be disabled. Either a Date object,
or a string in |
daysofweekdisabled |
Days of the week that should be disabled. Should be a integer vector with values from 0 (Sunday) to 6 (Saturday). |
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 |
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::dateInput()
shiny::dateInput("date", "A Date") twDateInput("date", "A Date", container_class = "CONTAINER", label_class = "LABEL", input_class = "INPUT" ) # basic full shiny example library(shiny) ui <- fluidPage( use_tailwind(), twDateInput( "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" ), 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.