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 c6fc73b commit f8659b7
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
4 changes: 3 additions & 1 deletion R/get_calendar.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@
#' ## Calendar for January 1970 ----
#' head(get_calendar(year = 1970, month = 1))
#'
#' \dontrun{
#' ## Change the locale (Spanish) ----
#' head(get_calendar(year = 1970, month = 1, lang = "es_SP"))
#' head(get_calendar(year = 1970, month = 1, lang = "Spanish"))
#' }

get_calendar <- function(year = format(Sys.Date(), "%Y"),
month = format(Sys.Date(), "%m"), weekend = FALSE,
Expand Down
6 changes: 4 additions & 2 deletions R/get_month_name.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
#' ## Default ----
#' get_month_name(month = 4)
#'
#' \dontrun{
#' ## Get Spanish name ----
#' get_month_name(month = 4, lang = "es_SP")
#' get_month_name(month = 4, lang = "Spanish")
#'
#' ## Get Finnish name ----
#' get_month_name(month = 4, lang = "fi_FI")
#' get_month_name(month = 4, lang = "Finnish")
#' }

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

Expand Down
6 changes: 4 additions & 2 deletions R/get_weekday_name.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
#' ## Change date format ----
#' get_weekday_name("01/04/2024", format = "%d/%m/%Y")
#'
#' \dontrun{
#' ## Get Spanish name ----
#' get_weekday_name("2024-04-01", lang = "es_SP")
#' get_weekday_name("2024-04-01", lang = "Spanish")
#'
#' ## Get Finnish name ----
#' get_weekday_name("2024-04-01", lang = "fi_FI")
#' get_weekday_name("2024-04-01", lang = "Finnish")
#' }

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

Expand Down
4 changes: 3 additions & 1 deletion man/get_calendar.Rd

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

6 changes: 4 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.

6 changes: 4 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 f8659b7

Please sign in to comment.