dreamRs / shinyWidgets

shinyWidgets : Extend widgets available in shiny
https://dreamrs.github.io/shinyWidgets/
GNU General Public License v3.0
833 stars 153 forks source link

updateAirDateInput() behaviour inconsistent when server and client timezones differ #695

Open hdmm3 opened 6 months ago

hdmm3 commented 6 months ago

I'm having an issue when calling updateAirDateInput(). The input datetime is never the one returned by the widget (through input$dateInput). This seems to happen only when the shiny server is running at a different timezone as the client. On the server side the timezone is picked through Sys.timezone() here and then that date is shifted to the client timezone. If both client and server timezones are the same they will coincide, but if they don't, the incorrect shifting will happen. A quick way to test this issue is by calling something like this:

updateAirDateInput(
   inputId = "theDateInput",
   value = input$theDateInput
)

Which should keep the value constant, but if the server and client timezones are different, the value will keep shifting the datetime at every call. Different timezones between server and client can be tested locally by running a rocker image with the app, which is set to UTC by default. The shiny client will pick your local timezone from the browser.

Originally posted by @hdmm3 in https://github.com/dreamRs/shinyWidgets/issues/643#issuecomment-2091824003