summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--app/components/Account.js11
-rw-r--r--app/containers/AccountPage.js2
-rw-r--r--test/components/Account.spec.js1
3 files changed, 12 insertions, 2 deletions
diff --git a/app/components/Account.js b/app/components/Account.js
index 9b6e1c8dea..bcb2c11ebd 100644
--- a/app/components/Account.js
+++ b/app/components/Account.js
@@ -14,6 +14,7 @@ import type { AccountToken } from '../lib/daemon-rpc';
export type AccountProps = {
accountToken: AccountToken,
accountExpiry: string,
+ expiryLocale: string,
updateAccountExpiry: () => Promise<void>,
onLogout: () => void,
onClose: () => void,
@@ -76,9 +77,15 @@ export default class Account extends Component<AccountProps, AccountState> {
render() {
const expiry = moment(this.props.accountExpiry);
- const formattedAccountToken = formatAccount(this.props.accountToken || '');
- const formattedExpiry = expiry.format('hA, D MMMM YYYY').toUpperCase();
const isOutOfTime = expiry.isSameOrBefore(moment());
+ const formattedAccountToken = formatAccount(this.props.accountToken || '');
+ const formattedExpiry = expiry.toDate().toLocaleString(this.props.expiryLocale, {
+ day: 'numeric',
+ month: 'long',
+ year: 'numeric',
+ hour: 'numeric',
+ minute: 'numeric',
+ });
return (
<Layout>
diff --git a/app/containers/AccountPage.js b/app/containers/AccountPage.js
index 2c23d326d8..a85ad3d43f 100644
--- a/app/containers/AccountPage.js
+++ b/app/containers/AccountPage.js
@@ -1,5 +1,6 @@
// @flow
+import { remote } from 'electron';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { push } from 'react-router-redux';
@@ -14,6 +15,7 @@ import type { SharedRouteProps } from '../routes';
const mapStateToProps = (state: ReduxState) => ({
accountToken: state.account.accountToken,
accountExpiry: state.account.expiry,
+ expiryLocale: remote.app.getLocale(),
});
const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) => {
const { copyAccountToken } = bindActionCreators(accountActions, dispatch);
diff --git a/test/components/Account.spec.js b/test/components/Account.spec.js
index 9d6e1cdbe8..a850c6af06 100644
--- a/test/components/Account.spec.js
+++ b/test/components/Account.spec.js
@@ -11,6 +11,7 @@ describe('components/Account', () => {
const defaultProps: AccountProps = {
accountToken: '1234',
accountExpiry: new Date('2038-01-01').toISOString(),
+ expiryLocale: 'en-US',
updateAccountExpiry: () => Promise.resolve(),
onCopyAccountToken: () => {},
onClose: () => {},