burgerga / shinyTime

A timeInput widget for Shiny
https://burgerga.github.io/shinyTime/
Other
28 stars 2 forks source link

Error in roundTime: "POSIXt" %in% class(time) is not TRUE #18

Closed Wesseldr closed 2 years ago

Wesseldr commented 2 years ago

Hi,

Just a little breaking change I ran into between version 1.0.1 and 1.0.2, sticking to the examples probably would help in the first place ;-)

Working in version 1.0.1

timeInput("or_start_time", "Range Start time:",
        seconds = FALSE,
        minute.steps = 1,
        value = as_hms("9:00:00") # as_hms is from the hms library
      ),

In version 1.0.2 if fails with an error: "Error in roundTime: "POSIXt" %in% class(time) is not TRUE"

From version 1.0.2+ the use of as_hms seems to stop working and is best to use the strptime("9:00:00", "%T") function.

New structure that works again, not using the as_hms any more and use strptime

timeInput("or_start_time", "Range Start time:",
        seconds = FALSE,
        minute.steps = 1,
        value = strptime("9:00:00", "%T")
      ),
burgerga commented 2 years ago

Ah that is annoying, supporting hms would be nice indeed. It seemed like an easy fix, but unfortunately on my first attempt the timezone problems return (#11). So I need to write some more unit tests over the weekend ;)

burgerga commented 2 years ago

I think I fixed it, can you try with remotes::install_github("burgerga/shinyTime")? (bonus: character input)

Wesseldr commented 2 years ago

YES! Works like a charm :-) Both hms and the bonus character input :-)

Issue can be closed is resolved in: 1.0.2.9000

Thnx! for the "mega snelle fix ;-)"

burgerga commented 2 years ago

No problem, will try to send it to CRAN asap :)

burgerga commented 2 years ago

1.0.3 accepted by CRAN, should be available in the coming hours ;)