Description Usage Arguments Value Examples
View source: R/utility_functions.R
Shiny doesn't have a way to restrict selection at month level. This function tries to overcome this shortfall by adding an extra more argument minviewmode.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
inputId |
The input slot that will be used to access the value. |
label |
Display label for the control, or NULL for no label. |
start |
The initial start 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. |
end |
The initial end 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 of 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". |
minviewmode |
The selection level to stop the date hierarchy, "months" by default. |
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. '400px', or '100%'; see validateCssUnit(). |
A date range input for shiny.
1 2 3 4 5 6 7 | if (interactive()) {
ui <- shiny::fluidPage(
dateRangeMonthsInput("daterange1", "Date range:", start = "2001-01-01"
, end = "2010-12-31", minviewmode = "months")
)
shiny::shinyApp(ui, server = function(input, output) { })
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.