Skip to content

Commit 2dccd33

Browse files
committed
actual countdown from the scheduled time
1 parent 4878717 commit 2dccd33

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/countdown/server.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
library(shiny)
2+
library(lubridate)
23

34
title <- 'Data Visualization 4'
45
subtitle <- 'Data Visualization in Production with Shiny'
6+
schedule <- as.POSIXct('2023-04-24 11:30:00')
57

68
server <- function(input, output) {
79
output$title <- renderText(title)
@@ -11,6 +13,6 @@ server <- function(input, output) {
1113
## as there's no external dependency triggering changes here (e.g. an input change)
1214
## that would automatically update this object to reactive
1315
invalidateLater(250)
14-
as.character(Sys.time())
16+
as.character(round(as.period(schedule - Sys.time())))
1517
})
1618
}

0 commit comments

Comments
 (0)