Skip to content

Commit

Permalink
Merge pull request #9 from NorwegianVeterinaryInstitute/main-trish
Browse files Browse the repository at this point in the history
Add time widget
  • Loading branch information
trishangu authored Sep 26, 2024
2 parents c4b0d98 + 86890a0 commit 0dda61a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 3 additions & 0 deletions app.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ library(shiny)
library(bslib)
library(pins)
library(DT)
library(dplyr)
library(shinyjs)
library(shinyTime)

# Source the modules
source('mod_sidebar.R')
Expand Down
3 changes: 0 additions & 3 deletions mod_mainPanel.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
library(shiny)
library(DT)

# Main Panel UI Module
mainPanelUI <- function(id) {
ns <- NS(id)
Expand Down
6 changes: 2 additions & 4 deletions mod_sidebar.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
library(shiny)

# Sidebar UI Module
sidebarUI <- function(id) {
ns <- NS(id)

tagList(
dateInput(ns('date'), 'Select Date:', value = Sys.Date()),
selectInput(ns('hour'), 'Select Hour:', choices = 9:15),
timeInput(ns("hour"), "Time:", value = strptime("12:00:00", "%T"), minute.steps = 10),
selectInput(
ns('room'),
'Select Room:',
Expand Down Expand Up @@ -101,7 +99,7 @@ sidebarServer <- function(id, board) {

# Clear the inputs after submission
updateDateInput(session, "date", value = Sys.Date())
updateSelectInput(session, "hour", selected = NULL)
updateTimeInput(session, "hour", value = strptime("12:00:00", "%T"))
updateSelectInput(session, "room", selected = NULL)
updateSelectInput(session, "section", selected = NULL)
updateTextInput(session, "person", value = "")
Expand Down

0 comments on commit 0dda61a

Please sign in to comment.