Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

326
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!