R/internal.R

Defines functions datetime2list

#' @import lubridate
#' @noRd
datetime2list <- function(dt, sec){
  list(
    date = list(
      year = year(dt),
      month = month(dt),
      date = day(dt)
    ),
    time = if(sec) list(
      hour = hour(dt),
      minute = minute(dt),
      second = floor(second(dt))
    ) else list(
      hour = hour(dt),
      minute = minute(dt)
    )
  )
}

Try the shinyDatetimePickers package in your browser

Any scripts or data that you put into this service are public.

shinyDatetimePickers documentation built on June 25, 2024, 1:16 a.m.