1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-28 18:43:26 +00:00

[PM-24229] Preserve existing cipher date fields when using CipherExport.toView (#15993)

* [PM-24229] Ensure existing dates are persisted when using CipherExport.toView

* [PM-24229] Test both null and undefined

* [PM-24229] Add test for copied date values
This commit is contained in:
Shane Melton
2025-08-22 12:21:23 -07:00
committed by GitHub
parent dd4ec9c5d9
commit 65230a9c3e
2 changed files with 47 additions and 3 deletions

View File

@@ -81,9 +81,9 @@ export class CipherExport {
view.passwordHistory = req.passwordHistory.map((ph) => PasswordHistoryExport.toView(ph));
}
view.creationDate = req.creationDate ? new Date(req.creationDate) : null;
view.revisionDate = req.revisionDate ? new Date(req.revisionDate) : null;
view.deletedDate = req.deletedDate ? new Date(req.deletedDate) : null;
view.creationDate = req.creationDate ? new Date(req.creationDate) : view.creationDate;
view.revisionDate = req.revisionDate ? new Date(req.revisionDate) : view.revisionDate;
view.deletedDate = req.deletedDate ? new Date(req.deletedDate) : view.deletedDate;
return view;
}