@welldot/utils

addDateDuration

Adds times × duration to a calendar date. Years and months are applied first; when the resulting day does not exist in the target month, the month's last day is used. Weeks and days are then added. Returns undefined for a malformed date.

addDateDuration(date, duration, times?): string | undefined

Adds times × duration to a calendar date. Years and months are applied first; when the resulting day does not exist in the target month, the month's last day is used. Weeks and days are then added. Returns undefined for a malformed date.

Parameters

date

string

duration

DateDuration

times?

number = 1

Returns

string | undefined