shinyWidgets icon indicating copy to clipboard operation
shinyWidgets copied to clipboard

airdatepicker with time dose not show time on the 1st of the month at 12:00 am

Open motyocska opened this issue 4 years ago • 3 comments

Hi Victor,

found a bit strange behavior on the date and time picker: the 1st of each month at 00:00:00 the time will not be shown on the output for some reason. Reproducable on demoAirDatepicker("timepicker") if you just select the 1st of April lets say and set time to 12:00 am, the text output will only show date. is this behaviour intentional? if yes would you have a thought on how to circumvent it and get the time also displayed?

thanks,

Andras

motyocska avatar Apr 23 '20 15:04 motyocska

the time shows on the picker itself but not on the text output below where you print the selection...

motyocska avatar Apr 23 '20 15:04 motyocska

Hello, The input value is of class POSIXt, it's the print method that don't display hours/minutes/seconds for midnight, you can try in your console:

as.POSIXct("2020-04-01 00:00:00")
# [1] "2020-04-01 CEST"
as.POSIXct("2020-04-01 00:00:01")
# [1] "2020-04-01 00:00:01 CEST"

lubridate::hour(as.POSIXct("2020-04-01 00:00:00"))
# [1] 0

Victor

pvictor avatar Apr 23 '20 15:04 pvictor

I faced this issue in a different package. Possibly related https://stackoverflow.com/questions/76723008/cut-datetime-dropping-timestamp-in-windows-but-not-in-ubuntu

matiasandina avatar Aug 04 '23 14:08 matiasandina