Skip to content

Commit

Permalink
Update label-date documentation
Browse files Browse the repository at this point in the history
The docs were confusingly referencing the superseded `date_format` `time_format` and `date_short` functions.
  • Loading branch information
Moohan authored May 14, 2024
1 parent 84560bf commit 228d448
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/label-date.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#' suffix to the input (ns, us, ms, s, m, h, d, w).
#'
#' @inherit label_number return
#' @param format For `date_format()` and `time_format()` a date/time format
#' @param format For `label_date()` and `label_time()` a date/time format
#' string using standard POSIX specification. See [strptime()] for details.
#'
#' For `date_short()` a character vector of length 4 giving the format
#' For `label_date_short()` a character vector of length 4 giving the format
#' components to use for year, month, day, and hour respectively.
#' @param tz a time zone name, see [timezones()]. Defaults
#' to UTC
Expand All @@ -31,9 +31,9 @@
#'
#' two_months <- date_range("2020-05-01", 60)
#' demo_datetime(two_months)
#' demo_datetime(two_months, labels = date_format("%m/%d"))
#' demo_datetime(two_months, labels = date_format("%e %b", locale = "fr"))
#' demo_datetime(two_months, labels = date_format("%e %B", locale = "es"))
#' demo_datetime(two_months, labels = label_date("%m/%d"))
#' demo_datetime(two_months, labels = label_date("%e %b", locale = "fr"))
#' demo_datetime(two_months, labels = label_date("%e %B", locale = "es"))
#' # ggplot2 provides a short-hand:
#' demo_datetime(two_months, date_labels = "%m/%d")
#'
Expand Down

0 comments on commit 228d448

Please sign in to comment.