Skip to content

Commit 84a34a6

Browse files
committed
Calendar
- documentation improvements - remove subtraction of day from input date bounds
1 parent e124fb8 commit 84a34a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/Calendar.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#' @title Get Market Calendar Times
66
#'
77
#' @description The calendar API serves the full list of market days from 1970 to 2029. It can also be queried by specifying a start and/or end time to narrow down the results. In addition to the dates, the response also contains the specific open and close times for the market days, taking into account early closures. See [Calendar](https://alpaca.markets/docs/api-documentation/api-v2/calendar/) Endpoint for details.
8-
#' @param from `(Date/Datetime/POSIXct/character)` in YYYY-MM-DD format. Starting date of request. Defaults to today. Calendar data goes back to 1970.
9-
#' @param to `(Date/Datetime/POSIXct/character)` in YYYY-MM-DD format. Ending date of request. Default to today. Calendar data goes to 2029.
8+
#' @param from `(Date/Datetime/POSIXct/character)` in YYYY-MM-DD format. Starting date of request. Defaults to today. Calendar data goes back to 1970. If blank, defaults to today's date.
9+
#' @param to `(Date/Datetime/POSIXct/character)` in YYYY-MM-DD format. Ending date of request. Default to today. Calendar data goes to 2029. If blank, defaults to today's date.
1010
#' @inheritParams account
1111
#' @return Calendar \code{tibble} A [Calendar](https://alpaca.markets/docs/api-documentation/api-v2/calendar/#calendar-entity) Object consisting of the following:
1212
#' \itemize{
@@ -48,7 +48,7 @@ calendar <- function(from = NULL, to = NULL, v = 2){
4848
if (any(.null)){
4949
message(paste0(paste0("`",names(.null)[.null],"`", collapse = ", "), " arg(s) is/are NULL, setting from/to to ", lubridate::today()))
5050
.bounds <- purrr::map(.bounds, ~{
51-
if (is.null(.x)) lubridate::today() - lubridate::days(1) else try_date(.x)
51+
if (is.null(.x)) lubridate::today() else try_date(.x)
5252
})
5353
}
5454
# Check for weekend values and warn if weekend

0 commit comments

Comments
 (0)