diff --git a/DESCRIPTION b/DESCRIPTION index 0efd672733dc8637bad07d7e76de3ef909371649..4853f3505709daf93a2c9f7ab2876127e5a59f00 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: airGRteaching Type: Package Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included) -Version: 0.2.10.4 +Version: 0.2.10.5 Date: 2020-04-14 Authors@R: c( person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"), diff --git a/NEWS.md b/NEWS.md index fca9f213d2a60a1e5cf3adc9449351cb1079764c..575fa9e55623604915bd6122c44791787a78ea19 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ -### 0.2.10.4 Release Notes (2020-04-14) +### 0.2.10.5 Release Notes (2020-04-14) #### New features diff --git a/inst/ShinyGR/server.R b/inst/ShinyGR/server.R index 30ad773d0d2f53466d598502c74ea31ee45f82c7..1dce7a1c880ef9fa2ef3befa26d7cbe71f8a6393 100644 --- a/inst/ShinyGR/server.R +++ b/inst/ShinyGR/server.R @@ -442,9 +442,10 @@ shinyServer(function(input, output, session) { # } # } else { if (dateWindow[1L] != dateWindow[2L]) { + timeFormat <- ifelse(input$HydroModel == "GR2M", "%Y-%m", "%F") updateSliderInput(session, inputId = "Period", value = dateWindow, ### + .TypeModelGR(input$HydroModel)$TimeLag, - timeFormat = "%F", timezone = "+0000") + timeFormat = timeFormat, timezone = "+0000") } # } } @@ -476,49 +477,57 @@ shinyServer(function(input, output, session) { ## Reset period slider responds to dygraphs to mouse clicks observeEvent({input$dyPlotTSq_click}, { + timeFormat <- ifelse(input$HydroModel == "GR2M", "%Y-%m", "%F") updateSliderInput(session, inputId = "Period", value = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]], tz = "UTC"), - timeFormat = "%F", timezone = "+0000") + timeFormat = timeFormat, timezone = "+0000") }, priority = +10) observeEvent({input$dyPlotTSe_click}, { + timeFormat <- ifelse(input$HydroModel == "GR2M", "%Y-%m", "%F") updateSliderInput(session, inputId = "Period", value = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]], tz = "UTC"), - timeFormat = "%F", timezone = "+0000") + timeFormat = timeFormat, timezone = "+0000") }, priority = +10) observeEvent({input$dyPlotSVs_click}, { + timeFormat <- ifelse(input$HydroModel == "GR2M", "%Y-%m", "%F") updateSliderInput(session, inputId = "Period", value = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]], tz = "UTC"), - timeFormat = "%F", timezone = "+0000") + timeFormat = timeFormat, timezone = "+0000") }, priority = +10) observeEvent({input$dyPlotSVq_click}, { + timeFormat <- ifelse(input$HydroModel == "GR2M", "%Y-%m", "%F") updateSliderInput(session, inputId = "Period", value = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]], tz = "UTC"), - timeFormat = "%F", timezone = "+0000") + timeFormat = timeFormat, timezone = "+0000") }, priority = +10) observeEvent({input$dyPlotMDp_click}, { + timeFormat <- ifelse(input$HydroModel == "GR2M", "%Y-%m", "%F") updateSliderInput(session, inputId = "Period", value = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]], tz = "UTC"), - timeFormat = "%F", timezone = "+0000") + timeFormat = timeFormat, timezone = "+0000") }, priority = +10) observeEvent({input$dyPlotMDe_click}, { + timeFormat <- ifelse(input$HydroModel == "GR2M", "%Y-%m", "%F") updateSliderInput(session, inputId = "Period", value = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]], tz = "UTC"), - timeFormat = "%F", timezone = "+0000") + timeFormat = timeFormat, timezone = "+0000") }, priority = +10) observeEvent({input$dyPlotMDq_click}, { + timeFormat <- ifelse(input$HydroModel == "GR2M", "%Y-%m", "%F") updateSliderInput(session, inputId = "Period", value = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]], tz = "UTC"), - timeFormat = "%F", timezone = "+0000") + timeFormat = timeFormat, timezone = "+0000") }, priority = +10) ## Time window slider and dataset choosen on the Summary sheet panel observeEvent({input$Dataset}, { + timeFormat <- ifelse(input$HydroModel == "GR2M", "%Y-%m", "%F") updateSliderInput(session, inputId = "Period", min = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]][1L], tz = "UTC"), max = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]][2L], tz = "UTC"), value = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]], tz = "UTC"), - timeFormat = "%F", timezone = "+0000") + timeFormat = timeFormat, timezone = "+0000") updateSelectInput(session, inputId = "DatasetSheet", choices = .ShinyGR.args$NamesObsBV, selected = input$Dataset)