mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
* Format the fieldvalue as a LocaleDateString instead of epoch when importing a date from 1P This would be better solved by storing it as a date FieldType instead of Text. But since it is unclear when new field types are added, this solution serves as a fix for now and also guides the solution when new fieldtype exists. * Remove trailing whitespace * Add tests for custom fields of 1pif imported identity * Change representation of 1pif imported dates to UTC string * Changes after running prettier Co-authored-by: Daniel James Smith <djsmith@web.de>
This commit is contained in:
@@ -172,7 +172,11 @@ export class OnePassword1PifImporter extends BaseImporter implements Importer {
|
||||
return;
|
||||
}
|
||||
|
||||
const fieldValue = field[valueKey].toString();
|
||||
// TODO: when date FieldType exists, store this as a date field type instead of formatted Text if k is 'date'
|
||||
const fieldValue =
|
||||
field.k === "date"
|
||||
? new Date(field[valueKey] * 1000).toUTCString()
|
||||
: field[valueKey].toString();
|
||||
const fieldDesignation =
|
||||
field[designationKey] != null ? field[designationKey].toString() : null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user