mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-30 13:03:53 +01:00
standardize date types
This commit is contained in:
parent
d0c51bacfd
commit
9bd8b73e27
@ -4,7 +4,7 @@ export class LoginApi {
|
||||
uris: LoginUriApi[];
|
||||
username: string;
|
||||
password: string;
|
||||
passwordRevisionDate?: Date;
|
||||
passwordRevisionDate: string;
|
||||
totp: string;
|
||||
|
||||
constructor(data: any) {
|
||||
|
@ -6,7 +6,7 @@ export class LoginData {
|
||||
uris: LoginUriData[];
|
||||
username: string;
|
||||
password: string;
|
||||
passwordRevisionDate?: Date;
|
||||
passwordRevisionDate: string;
|
||||
totp: string;
|
||||
|
||||
constructor(data?: LoginApi) {
|
||||
|
@ -20,7 +20,7 @@ export class Login extends Domain {
|
||||
return;
|
||||
}
|
||||
|
||||
this.passwordRevisionDate = obj.passwordRevisionDate;
|
||||
this.passwordRevisionDate = obj.passwordRevisionDate != null ? new Date(obj.passwordRevisionDate) : null;
|
||||
this.buildDomainModel(this, obj, {
|
||||
username: null,
|
||||
password: null,
|
||||
@ -55,7 +55,7 @@ export class Login extends Domain {
|
||||
|
||||
toLoginData(): LoginData {
|
||||
const l = new LoginData();
|
||||
l.passwordRevisionDate = this.passwordRevisionDate;
|
||||
l.passwordRevisionDate = this.passwordRevisionDate != null ? this.passwordRevisionDate.toISOString() : null;
|
||||
this.buildDataModel(this, l, {
|
||||
username: null,
|
||||
password: null,
|
||||
|
@ -39,7 +39,8 @@ export class CipherRequest {
|
||||
uris: null,
|
||||
username: cipher.login.username ? cipher.login.username.encryptedString : null,
|
||||
password: cipher.login.password ? cipher.login.password.encryptedString : null,
|
||||
passwordRevisionDate: cipher.login.passwordRevisionDate,
|
||||
passwordRevisionDate: cipher.login.passwordRevisionDate != null ?
|
||||
cipher.login.passwordRevisionDate.toISOString() : null,
|
||||
totp: cipher.login.totp ? cipher.login.totp.encryptedString : null,
|
||||
};
|
||||
|
||||
|
@ -9,7 +9,7 @@ export class BillingResponse {
|
||||
upcomingInvoice: BillingInvoiceResponse;
|
||||
charges: BillingChargeResponse[] = [];
|
||||
license: any;
|
||||
expiration: Date;
|
||||
expiration: string;
|
||||
|
||||
constructor(response: any) {
|
||||
this.storageName = response.StorageName;
|
||||
@ -43,11 +43,11 @@ export class BillingSourceResponse {
|
||||
}
|
||||
|
||||
export class BillingSubscriptionResponse {
|
||||
trialStartDate: Date;
|
||||
trialEndDate: Date;
|
||||
periodStartDate: Date;
|
||||
periodEndDate: Date;
|
||||
cancelledDate: Date;
|
||||
trialStartDate: string;
|
||||
trialEndDate: string;
|
||||
periodStartDate: string;
|
||||
periodEndDate: string;
|
||||
cancelledDate: string;
|
||||
cancelAtEndDate: boolean;
|
||||
status: string;
|
||||
cancelled: boolean;
|
||||
@ -83,7 +83,7 @@ export class BillingSubscriptionItemResponse {
|
||||
}
|
||||
|
||||
export class BillingInvoiceResponse {
|
||||
date: Date;
|
||||
date: string;
|
||||
amount: number;
|
||||
|
||||
constructor(response: any) {
|
||||
@ -93,7 +93,7 @@ export class BillingInvoiceResponse {
|
||||
}
|
||||
|
||||
export class BillingChargeResponse {
|
||||
createdDate: Date;
|
||||
createdDate: string;
|
||||
amount: number;
|
||||
paymentSource: BillingSourceResponse;
|
||||
status: string;
|
||||
|
@ -1,13 +1,13 @@
|
||||
export class BreachAccountResponse {
|
||||
addedDate: Date;
|
||||
breachDate: Date;
|
||||
addedDate: string;
|
||||
breachDate: string;
|
||||
dataClasses: string[];
|
||||
description: string;
|
||||
domain: string;
|
||||
isActive: boolean;
|
||||
isVerified: boolean;
|
||||
logoType: string;
|
||||
modifiedDate: Date;
|
||||
modifiedDate: string;
|
||||
name: string;
|
||||
pwnCount: number;
|
||||
title: string;
|
||||
|
@ -10,7 +10,7 @@ export class EventResponse {
|
||||
groupId: string;
|
||||
organizationUserId: string;
|
||||
actingUserId: string;
|
||||
date: Date;
|
||||
date: string;
|
||||
deviceType: DeviceType;
|
||||
ipAddress: string;
|
||||
|
||||
|
@ -13,7 +13,7 @@ export class OrganizationBillingResponse extends OrganizationResponse {
|
||||
subscription: BillingSubscriptionResponse;
|
||||
upcomingInvoice: BillingInvoiceResponse;
|
||||
charges: BillingChargeResponse[] = [];
|
||||
expiration: Date;
|
||||
expiration: string;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
@ -27,6 +27,6 @@ export class OrganizationBillingResponse extends OrganizationResponse {
|
||||
if (response.Charges != null) {
|
||||
this.charges = response.Charges.map((c: any) => new BillingChargeResponse(c));
|
||||
}
|
||||
this.expiration = response.Expiration != null ? new Date(response.Expiration) : null;
|
||||
this.expiration = response.Expiration;
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import { Folder } from '../domain/folder';
|
||||
export class FolderView implements View {
|
||||
id: string = null;
|
||||
name: string;
|
||||
revisionDate: Date;
|
||||
|
||||
constructor(f?: Folder) {
|
||||
if (!f) {
|
||||
@ -12,5 +13,6 @@ export class FolderView implements View {
|
||||
}
|
||||
|
||||
this.id = f.id;
|
||||
this.revisionDate = f.revisionDate;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user