Skip to content

Commit

Permalink
Merge pull request #63 from bjuppa/add-quarters-to-explaindate
Browse files Browse the repository at this point in the history
Implement addQuarters method on ExPlainDate
  • Loading branch information
bjuppa authored Jul 7, 2023
2 parents c43c0f1 + c37cbd4 commit 5e3ebd0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ExPlainDate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
},
Expand Down

0 comments on commit 5e3ebd0

Please sign in to comment.