Skip to content

Commit

Permalink
Implement addQuarters method
Browse files Browse the repository at this point in the history
See comment in #58
  • Loading branch information
bjuppa committed Jul 7, 2023
1 parent c43c0f1 commit c37cbd4
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 c37cbd4

Please sign in to comment.