mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 10:13:31 +00:00
[PM-11350] Use shared expiration year normalization util function (#10735)
* use shared expiration year normalization util function * use shared exp year normalization in web and desktop client * handle cases where input has leading zeroes * add utils tests * handle cases where input is all zeroes
This commit is contained in:
@@ -11,6 +11,7 @@ import { FolderView } from "@bitwarden/common/vault/models/view/folder.view";
|
||||
import { LoginUriView } from "@bitwarden/common/vault/models/view/login-uri.view";
|
||||
import { LoginView } from "@bitwarden/common/vault/models/view/login.view";
|
||||
import { SecureNoteView } from "@bitwarden/common/vault/models/view/secure-note.view";
|
||||
import { normalizeExpiryYearFormat } from "@bitwarden/common/vault/utils";
|
||||
|
||||
import { ImportResult } from "../models/import-result";
|
||||
|
||||
@@ -263,7 +264,8 @@ export abstract class BaseImporter {
|
||||
|
||||
cipher.card.expMonth = expiryMatch.groups.month;
|
||||
const year: string = expiryMatch.groups.year;
|
||||
cipher.card.expYear = year.length === 2 ? "20" + year : year;
|
||||
cipher.card.expYear = normalizeExpiryYearFormat(year);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user