Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

calendar

Create Semantic UI Calendar


Description

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

This function updates the date on a calendar

Usage

calendar(
  input_id,
  value = NULL,
  placeholder = NULL,
  type = "date",
  min = NA,
  max = NA
)

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

Arguments

input_id

ID of the calendar that will be updated

value

Initial value of the numeric input.

placeholder

Text visible in the input when nothing is inputted.

type

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

min

Minimum allowed value.

max

Maximum allowed value.

session

The session object passed to function given to shinyServer.

Examples

# Basic calendar
if (interactive()) {

  library(shiny)
  library(shiny.semantic)

  ui <- shinyUI(
    semanticPage(
      title = "Calendar example",
      calendar("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
calendar(
  name = "date_finish",
  placeholder = "Select End Date",
  min = "2019-01-01",
  max = "2020-01-01"
)

# Selecting month
calendar(
  name = "month",
  type = "month"
)

## End(Not run)

shiny.semantic

Semantic UI Support for Shiny

v0.4.2
MIT + file LICENSE
Authors
Filip Stachura [aut], Dominik Krzeminski [cre], Krystian Igras [aut], Adam Forys [aut], Paweł Przytuła [aut], Jakub Chojna [aut], Olga Mierzwa-Sulima [aut], Ashley Baldry [ctb], Jakub Chojna [ctb], Olga Mierzwa-Sulima [ctb], Pedro Manuel Coutinho da Silva [ctb], Paweł Przytuła [ctb], Kamil Żyła [ctb], Rabii Bouhestine [ctb], Appsilon Sp. z o.o. [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.