From c37cbd43917bebee295d38959c85afedc496b64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Nilsved?= Date: Fri, 7 Jul 2023 08:07:44 +0200 Subject: [PATCH] Implement addQuarters method See comment in #58 --- ExPlainDate.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ExPlainDate.ts b/ExPlainDate.ts index 5f71415..e8f5474 100644 --- a/ExPlainDate.ts +++ b/ExPlainDate.ts @@ -5,6 +5,7 @@ import { QuarterNumber, WeekDay, WeekDayNumber } from "./constants.ts"; import { addDays } from "./utils/addDays.ts"; import { addBusinessDays } from "./utils/addBusinessDays.ts"; import { addMonths } from "./utils/addMonths.ts"; +import { addQuarters } from "./utils/addQuarters.ts"; import { addYears } from "./utils/addYears.ts"; import { startOfBusinessWeek } from "./utils/startOfBusinessWeek.ts"; import { startOfWeekend } from "./utils/startOfWeekend.ts"; @@ -94,6 +95,7 @@ export interface ExtendedPlainDate extends ComPlainDate { addDays: (days: number) => this; addBusinessDays: (days: number) => this; addMonths: (months: number) => this; + addQuarters: (quarters: number) => this; addYears: (years: number) => this; /** Monday of the current week */ @@ -226,6 +228,9 @@ export function ExPlainDate({ year, month = 1, day = 1 }: { addMonths(months) { return addMonths(months)(this); }, + addQuarters(quarters) { + return addQuarters(quarters)(this); + }, addYears(years) { return addYears(years)(this); },