From 3b55d72e0f89c6b57ce996fad10f02fb3230f52b Mon Sep 17 00:00:00 2001 From: gras Date: Wed, 3 Apr 2024 21:16:55 +0200 Subject: [PATCH] This reverts commit 1e50f1b2e508295cb5924d1dcd1c81f0f750410b. --- src/common/Utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/Utils.ts b/src/common/Utils.ts index 4cafa1ad..a47898ce 100644 --- a/src/common/Utils.ts +++ b/src/common/Utils.ts @@ -224,7 +224,7 @@ export class Utils { //this function makes sure that if date is the 31st and you add a month, you will get the last day of the next month //so adding or subtracting a month from 31st of march will give 30th of april or 28th of february respectively (29th on leap years). static addMonthToDate(date: Date, numMonths: number) { - const result = new Date(date) + let result = new Date(date) const expectedMonth = ((date.getMonth() + numMonths) % 12 + 12) % 12; //inner %12 + 12 makes correct handling of negative months result.setMonth(result.getMonth() + numMonths); if (result.getMonth() !== expectedMonth) {