Learn R Programming

shiny.semantic (version 0.3.0)

uicalendar: Create Semantic UI Calendar

Description

This creates a default calendar input using Semantic UI. The input is available under input[[name]].

This function updates the date on a calendar

Usage

uicalendar(
  name,
  value = NULL,
  placeholder = NULL,
  type = "date",
  min = NA,
  max = NA
)

update_calendar(session, id, value = NULL, min = NULL, max = NULL)

Arguments

name

Input name. Reactive value is available under input[[name]].

value

The date to be set, default NULL

placeholder

Text visible in the input when nothing is inputted.

type

Select from 'year', 'month', 'date' and 'time'

min

Minimum date that will be possible to set, default NULL

max

Maximum date that will be possible to set, default NULL

session

The session object passed to function given to shinyServer.

id

ID of the calendar that will be updated

Examples

Run this code
# NOT RUN {
# Basic calendar
if (interactive()) {

  library(shiny)
  library(shiny.semantic)

  ui <- shinyUI(
    semanticPage(
      title = "Calendar example",
      uicalendar("date"),
      p("Selected date:"),
      textOutput("selected_date")
    )
  )

   server <- shinyServer(function(input, output, session) {
     output$selected_date <- renderText(
       as.character(input$date)
     )
   })

   shinyApp(ui = ui, server = server)
 }

# }
# NOT RUN {
# Calendar with max and min
uicalendar(
  name = "date_finish",
  placeholder = "Select End Date",
  min = "2019-01-01",
  max = "2020-01-01"
)

# Selecting month
uicalendar(
  name = "month",
  type = "month"
)
# }

Run the code above in your browser using DataLab