From 3b9d38e493c91ad9e61ea4876a86537426f2a04a Mon Sep 17 00:00:00 2001 From: Jackie Luo Date: Tue, 14 Jun 2016 15:03:35 -0700 Subject: [PATCH] fix(identity): Convert datetimes to milliseconds --- internal_packages/preferences/lib/tabs/preferences-identity.jsx | 2 +- src/flux/stores/identity-store.es6 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal_packages/preferences/lib/tabs/preferences-identity.jsx b/internal_packages/preferences/lib/tabs/preferences-identity.jsx index 6d2567ebe..51e59523d 100644 --- a/internal_packages/preferences/lib/tabs/preferences-identity.jsx +++ b/internal_packages/preferences/lib/tabs/preferences-identity.jsx @@ -121,7 +121,7 @@ class PreferencesIdentity extends React.Component { return (
- Your subscription will renew on {new Date(identity.valid_until).toLocaleDateString()}. Enjoy N1! + Your subscription will renew on {new Date(identity.valid_until * 1000).toLocaleDateString()}. Enjoy N1!
) diff --git a/src/flux/stores/identity-store.es6 b/src/flux/stores/identity-store.es6 index 4e13b781f..19648a859 100644 --- a/src/flux/stores/identity-store.es6 +++ b/src/flux/stores/identity-store.es6 @@ -83,7 +83,7 @@ class IdentityStore extends NylasStore { if (!this._identity || (this._identity.valid_until === null)) { return State.Trialing; } - if (new Date(this._identity.valid_until) < new Date()) { + if (new Date(this._identity.valid_until * 1000) < new Date()) { return State.Lapsed; } return State.Valid;