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 DateTimeRangePicker package in your browser

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

DateTimeRangePicker documentation built on Sept. 3, 2023, 9:06 a.m.