addPeriodToDate: function to add or subtract periods to dates

Description Usage Arguments Value Examples

Description

function to add or subtract periods to dates

Usage

1
addPeriodToDate(initialDate, period, numPeriods)

Arguments

initialDate

valid date in the YYYY-MM-DD format

period

a character string, one of "days", "weeks", "months" or "years"

numPeriods

an integer (can be negative) specifying the number of periods to add (or subtract)

Value

a date; note: this will account for leap years, if Feb 29 is passed, it will default to Feb 28th for non-leap years

Examples

1
none

erolbicero/tsconv documentation built on May 16, 2019, 8:49 a.m.