Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

328
Vistas
R shiny: one day difference between date selected on widget and returned date

The date returned by shinyMobile's f7DatePicker widget is one day before the actual date selected by the user.

I am based in France and everything works fine locally. The issue arises when deploying my app to shinyapps.io. Screenshots and a MRE below. Deployed MRE here.

server.R

library(shinyMobile)
# tried adding Sys.setenv(TZ='UTC'), to no avail

function(input, output, session) {
  output$date_output = renderUI(HTML(paste(input$date_input)))
}

ui.R

library(shinyMobile)

f7Page(
  f7DatePicker(
    'date_input',
    'Date entered by user:',
    value = NULL,
    maxDate = Sys.Date(), # tried setting to NULL, to no avail
    dateFormat = 'yyyy-mm-dd' # tried changing to 'mm-dd-yyyy' per https://stackoverflow.com/questions/7556591/is-the-javascript-date-object-always-one-day-off/31732581#31732581, to no avail
  ),
  div(style='padding-left:20px;',
    h5('Date recorded by the system:'),
    uiOutput('date_output')
  )
)

= = = = Local (no problem): = = = =

image

= = = = Remote (one day discrepancy!): = = = =

image

PS. I tried with Shiny's default dateInput and shinyWidgets' airDatePicker. None of them suffer from the issue, but unfortunately, they do not seem to be compatible with shinyMobile in terms of UI.

PPS. I think the solution might lie in this SO answer. Seems to be an issue related to different standards that javascript uses in different situations, and conversion to UTC (or not). If this is indeed the cause of the issue, that would require editing the js part of the R Shiny widget I guess, but I am not literate in javascript...

I would be grateful for any help or tip. Thanks!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

A fix to this issue was provided by the author of the shinyMobile package, David Granjon, via this commit. Many thanks to him!

And here is the link to the GitHub thread: https://github.com/RinteRface/shinyMobile/issues/204#issuecomment-1079532866

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda