Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

airDatePicker selecting dates works incorrectly in Docker container #697

Closed
Mkranj opened this issue Jun 7, 2024 · 3 comments
Closed

airDatePicker selecting dates works incorrectly in Docker container #697

Mkranj opened this issue Jun 7, 2024 · 3 comments

Comments

@Mkranj
Copy link

Mkranj commented Jun 7, 2024

So, this is a weird issue I noticed. Here is a small app.R example:

library(shiny)
library(shinyWidgets)

print("shinyWidgets version:")
print(packageVersion("shinyWidgets"))

ui <- fluidPage(
  h1("TESTING - airdatepicker"),
  airDatepickerInput("date_menu",
                     label = "Choose date range",
                     value = c(as.Date("2024-06-03"), Sys.Date()),
                     dateFormat = "dd. MM. yyyy.",
                     addon = "none",
                     minDate = "2023-07-08",
                     maxDate = Sys.Date(),
                     range = T,
                     language = "hr"
    ),
  textOutput("results")
  )

server <- function(input, output, session) {
  output$results <- renderText({
    paste0("The range spans from ",
           input$date_menu[1],
           " to ",
           input$date_menu[2])
  })
}

shinyApp(ui, server)

I can run this app on my computer, and I want to change the first day in timespan to be 01.03.2024. instead of 03.06.2024. I just click on 03.06, click left to March and click on the 1st day. It all works as expected.

However, when I run my app in a Docker container, this doesn't work! The selection stays the same, even if I clicked all the way through to March. This is very unintuitive to use, and I can't seem to find what the issue is, any help would be greatly appreciated.

Sample Dockerfile:

FROM rocker/r-ver:4.3.3

RUN apt-get update && apt-get install -y dialog apt-utils
RUN apt-get upgrade -y


RUN R -q -e "install.packages(c('shiny', 'shinyWidgets'))"
COPY app.R app.R

EXPOSE 3838

ENTRYPOINT ["R", "-q", "-e", "shiny::runApp(appDir = './', port = 3838, host = '0.0.0.0')"]

Building the image with docker build -t mkranj/airdatepicker --no-cache ..
Running the container with docker run -p 1234:3838 -it mkranj/airdatepicker:latest and going to http://localhost:1234/ in my browser.

@ZIBOWANGKANGYU
Copy link

I am experiencing similar problems on Docker only. On local machine it's fine.

@pvictor
Copy link
Member

pvictor commented Aug 19, 2024

Hi,
It appears to be a bug in the JavaScript library "air-datepicker", affecting at least the last 2 versions of the package on CRAN. Try installing from GitHub, it should fix the issue, I will make a new release on CRAN by the end of the month.

Victor

@Mkranj
Copy link
Author

Mkranj commented Sep 24, 2024

This is fixed with the v0.8.7 version of the package :)
Thank you!

@Mkranj Mkranj closed this as completed Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants