From f1b343e05663c7aacfa73680bc62d0b9dffaf3d0 Mon Sep 17 00:00:00 2001 From: Jonathan Prusik Date: Mon, 30 Sep 2024 12:01:42 -0400 Subject: [PATCH] fix incorrect handling of the first day of the next month is isCardExpired (#11337) --- libs/common/src/autofill/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/common/src/autofill/utils.ts b/libs/common/src/autofill/utils.ts index 86411691ea2..0b127e4b9da 100644 --- a/libs/common/src/autofill/utils.ts +++ b/libs/common/src/autofill/utils.ts @@ -82,10 +82,10 @@ export function isCardExpired(cipherCard: CardView): boolean { const parsedYear = parseInt(normalizedYear, 10); - // First day of the next month minus one, to get last day of the card month - const cardExpiry = new Date(parsedYear, parsedMonth + 1, 0); + // First day of the next month + const cardExpiry = new Date(parsedYear, parsedMonth + 1, 1); - return cardExpiry < now; + return cardExpiry <= now; } }