-
Notifications
You must be signed in to change notification settings - Fork 157
/
Copy pathcalendar-pro.R
105 lines (99 loc) · 2.67 KB
/
calendar-pro.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
theme = bslib::bs_theme(5),
tags$h2("Calendar Pro Input"),
fluidRow(
column(
width = 6,
calendarProInput(
inputId = "cal1",
label = "Calendar default:",
placeholder = "Select a date",
width = "100%"
),
verbatimTextOutput("res1"),
calendarProInput(
inputId = "cal3",
label = "Calendar with initial value:",
value = Sys.Date() + 1,
width = "100%"
),
verbatimTextOutput("res3"),
calendarProInput(
inputId = "cal5",
label = "Calendar without input field:",
inputMode = FALSE,
width = "300px"
),
verbatimTextOutput("res5"),
calendarProInput(
inputId = "cal7",
label = "Calendar with week numbers:",
placeholder = "Select a date",
enableWeekNumbers = TRUE,
width = "100%"
),
verbatimTextOutput("res7"),
calendarProInput(
inputId = "cal9",
label = "Calendar with format and locale:",
format = "%d/%m/%Y",
locale = "fr",
value = Sys.Date() + 1,
width = "100%"
),
verbatimTextOutput("res9"),
),
column(
width = 6,
calendarProInput(
inputId = "cal2",
label = "Calendar with multiple selection:",
mode = "multiple",
placeholder = "Select multiple dates",
width = "100%"
),
verbatimTextOutput("res2"),
calendarProInput(
inputId = "cal4",
label = "Calendar with range selection:",
mode = "multiple-ranged",
width = "100%"
),
verbatimTextOutput("res4"),
calendarProInput(
inputId = "cal6",
label = "Calendar (range) without input field:",
mode = "multiple-ranged",
type = "multiple",
displayMonthsCount = 2,
inputMode = FALSE,
width = "100%"
),
verbatimTextOutput("res6"),
calendarProInput(
inputId = "cal8",
label = "Calendar select week:",
mode = "multiple-ranged",
enableWeekNumbers = TRUE,
selectWeekNumbers = TRUE,
width = "100%"
),
verbatimTextOutput("res8")
)
)
)
server <- function(input, output, session) {
output$res1 <- renderPrint(input$cal1)
output$res2 <- renderPrint(input$cal2)
output$res3 <- renderPrint(input$cal3)
output$res4 <- renderPrint(input$cal4)
output$res5 <- renderPrint(input$cal5)
output$res6 <- renderPrint(input$cal6)
output$res7 <- renderPrint(input$cal7)
output$res8 <- renderPrint(input$cal8)
output$res9 <- renderPrint(input$cal9)
}
if (interactive())
shinyApp(ui, server)