mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
[PM-24000] Convert string date values to Date objects for CipherExport types (#15715)
This commit is contained in:
@@ -53,6 +53,7 @@ export class CipherExport {
|
||||
view.notes = req.notes;
|
||||
view.favorite = req.favorite;
|
||||
view.reprompt = req.reprompt ?? CipherRepromptType.None;
|
||||
view.key = req.key != null ? new EncString(req.key) : null;
|
||||
|
||||
if (req.fields != null) {
|
||||
view.fields = req.fields.map((f) => FieldExport.toView(f));
|
||||
@@ -80,9 +81,9 @@ export class CipherExport {
|
||||
view.passwordHistory = req.passwordHistory.map((ph) => PasswordHistoryExport.toView(ph));
|
||||
}
|
||||
|
||||
view.creationDate = req.creationDate;
|
||||
view.revisionDate = req.revisionDate;
|
||||
view.deletedDate = req.deletedDate;
|
||||
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;
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export class PasswordHistoryExport {
|
||||
|
||||
static toView(req: PasswordHistoryExport, view = new PasswordHistoryView()) {
|
||||
view.password = req.password;
|
||||
view.lastUsedDate = req.lastUsedDate;
|
||||
view.lastUsedDate = req.lastUsedDate ? new Date(req.lastUsedDate) : null;
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user