From 20e526a834a64879c031ba4a445f8efa8572b7fe Mon Sep 17 00:00:00 2001 From: Gerhard Burger Date: Wed, 10 Aug 2022 11:50:13 +0200 Subject: [PATCH] Add better documentation on timeInput return type (#14) --- NEWS.md | 1 + R/input-time.R | 6 +++++- man/timeInput.Rd | 7 ++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 8bff300..f6dd6c0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ - Replaced outdated shiny utils label functions (#16) - Added correct timezone handling to roundTime function (#11) +- Add information on timeInput return type (#14) # shinyTime 1.0.1 diff --git a/R/input-time.R b/R/input-time.R index b108e20..bd48ac2 100644 --- a/R/input-time.R +++ b/R/input-time.R @@ -12,7 +12,11 @@ #' @inheritParams shiny::textInput #' @param value The desired time value. Must be a instance of \code{\link{DateTimeClasses}}. #' @param seconds Show input for seconds. Defaults to TRUE. -#' @param minute.steps Round time to multiples of \code{minute.steps} (should be a whole number). If not NULL sets \code{seconds} to \code{FALSE}. +#' @param minute.steps Round time to multiples of \code{minute.steps} (should be a whole number). +#' If not NULL sets \code{seconds} to \code{FALSE}. +#' +#' @returns timeInput returns a \code{POSIXlt} object, which can be converted to +#' a \code{POSIXct} object with \code{as.POSIXct} for more efficient storage. #' #' @family shinyTime functions #' @seealso \code{\link{strptime}}, \code{\link{strftime}}, \code{\link{DateTimeClasses}} diff --git a/man/timeInput.Rd b/man/timeInput.Rd index 0cd5475..47d496c 100644 --- a/man/timeInput.Rd +++ b/man/timeInput.Rd @@ -15,7 +15,12 @@ timeInput(inputId, label, value = NULL, seconds = TRUE, minute.steps = NULL) \item{seconds}{Show input for seconds. Defaults to TRUE.} -\item{minute.steps}{Round time to multiples of \code{minute.steps} (should be a whole number). If not NULL sets \code{seconds} to \code{FALSE}.} +\item{minute.steps}{Round time to multiples of \code{minute.steps} (should be a whole number). +If not NULL sets \code{seconds} to \code{FALSE}.} +} +\value{ +timeInput returns a \code{POSIXlt} object, which can be converted to +a \code{POSIXct} object with \code{as.POSIXct} for more efficient storage. } \description{ Creates a time widget that consists of separate numeric inputs for the hours, minutes, and