R/date_pt_br.R

#' Date pt-br
#'
#' Transform the Sys.Date date in a pt-br formatted string.
#'
#'
#' @export
date_pt_br <- function() {

  months <- c("janeiro",
              "fevereiro",
              "março",
              "abril",
              "maio",
              "junho",
              "julho",
              "agosto",
              "setembro",
              "outrubro",
              "novembro",
              "dezembro")

  date <- Sys.Date()

  stringr::str_c(lubridate::day(date),
                 " de ",
                 months[lubridate::month(date)],
                 " de ",
                 lubridate::year(date))

}
williamorim/TSR documentation built on May 29, 2019, 11:58 a.m.