pretty_date_range: Format the display of a date period.

Description Usage Arguments Value Examples

View source: R/prettyDates.R

Description

Format the display of a date period.

Usage

1
pretty_date_range(date1, date2, separator = " - ", show_wday = FALSE)

Arguments

date1, date2

The dates to be formatted (either date objects or strings with the format "YYYY-MM-DD").

show_wday

Whether or not to display the day of the week. Default: FALSE dates. DEFAULT: " - "

Value

A string with both dates provided formatted.

Examples

1
2
3
4
5
6
7
8
prettyDateRange("9-20-2019", "09-21-2019", show_wday=FALSE)
# outputs "September 20th - 21st, 2019"

prettyDateRange("9-20-2019", "10-20-2019", show_wday=FALSE)
# outputs "September 20th - October 20th, 2019"

prettyDateRange("9-20-2019", "10-20-2020", show_wday=FALSE)
# outputs "September 20th, 2019 - October 20th, 2020"

niedermansam/marketR documentation built on Nov. 4, 2019, 10:06 p.m.