From 6d2a2aa852352646e9191fa25927d503036498f9 Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Mon, 23 Jan 2023 15:52:38 +0100 Subject: [PATCH] dashlane-csv-importer: Set month on import (#4284) --- libs/common/spec/importers/dashlane-csv-importer.spec.ts | 4 ++-- libs/common/src/importers/dashlane/dashlane-csv-importer.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/common/spec/importers/dashlane-csv-importer.spec.ts b/libs/common/spec/importers/dashlane-csv-importer.spec.ts index 50ae06a434c..9948b9e47c3 100644 --- a/libs/common/spec/importers/dashlane-csv-importer.spec.ts +++ b/libs/common/spec/importers/dashlane-csv-importer.spec.ts @@ -79,8 +79,8 @@ describe("Dashlane CSV Importer", () => { expect(cipher2.card.cardholderName).toBe("John Doe"); expect(cipher2.card.number).toBe("41111111111111111"); expect(cipher2.card.code).toBe("123"); - expect(cipher2.card.expMonth).toBe("01"); - expect(cipher2.card.expYear).toBe("23"); + expect(cipher2.card.expMonth).toBe("1"); + expect(cipher2.card.expYear).toBe("2023"); expect(cipher2.fields.length).toBe(2); diff --git a/libs/common/src/importers/dashlane/dashlane-csv-importer.ts b/libs/common/src/importers/dashlane/dashlane-csv-importer.ts index 46860fd4a8d..f0b54ebdda0 100644 --- a/libs/common/src/importers/dashlane/dashlane-csv-importer.ts +++ b/libs/common/src/importers/dashlane/dashlane-csv-importer.ts @@ -137,8 +137,7 @@ export class DashlaneCsvImporter extends BaseImporter implements Importer { cipher.card.number = row.cc_number; cipher.card.brand = this.getCardBrand(cipher.card.number); cipher.card.code = row.code; - cipher.card.expMonth = row.expiration_month; - cipher.card.expYear = row.expiration_year.substring(2, 4); + this.setCardExpiration(cipher, `${row.expiration_month}/${row.expiration_year}`); // If you add more mapped fields please extend this mappedValues = [