Skip to content

Commit

Permalink
doc: update function examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasverus committed Mar 31, 2024
1 parent 2badfe0 commit c6fc73b
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 12 deletions.
4 changes: 2 additions & 2 deletions R/get_calendar.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
#' ## Calendar for January 1970 ----
#' head(get_calendar(year = 1970, month = 1))
#'
#' ## Change the locale ----
#' head(get_calendar(year = 1970, month = 1, lang = "spanish"))
#' ## Change the locale (Spanish) ----
#' head(get_calendar(year = 1970, month = 1, lang = "es_SP"))

get_calendar <- function(year = format(Sys.Date(), "%Y"),
month = format(Sys.Date(), "%m"), weekend = FALSE,
Expand Down
9 changes: 7 additions & 2 deletions R/get_month_name.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@
#' @export
#'
#' @examples
#' ## Default ----
#' get_month_name(month = 4)
#' get_month_name(month = 4, lang = "spanish")
#' get_month_name(month = 4, lang = "finnish")
#'
#' ## Get Spanish name ----
#' get_month_name(month = 4, lang = "es_SP")
#'
#' ## Get Finnish name ----
#' get_month_name(month = 4, lang = "fi_FI")

get_month_name <- function(month, lang = NULL) {

Expand Down
11 changes: 9 additions & 2 deletions R/get_weekday_name.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@
#' @export
#'
#' @examples
#' ## Default ----
#' get_weekday_name("2024-04-01")
#'
#' ## Change date format ----
#' get_weekday_name("01/04/2024", format = "%d/%m/%Y")
#' get_weekday_name("2024-04-01", lang = "spanish")
#' get_weekday_name("2024-04-01", lang = "finnish")
#'
#' ## Get Spanish name ----
#' get_weekday_name("2024-04-01", lang = "es_SP")
#'
#' ## Get Finnish name ----
#' get_weekday_name("2024-04-01", lang = "fi_FI")

get_weekday_name <- function(date, format = "%Y-%m-%d", lang = NULL) {

Expand Down
4 changes: 2 additions & 2 deletions man/get_calendar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions man/get_month_name.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions man/get_weekday_name.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c6fc73b

Please sign in to comment.