mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 17:41:43 -05:00
Set correct moment locale
This commit is contained in:
parent
0074defdc2
commit
4ec9c08500
1 changed files with 5 additions and 3 deletions
|
@ -6,6 +6,7 @@ import withCurrentUser from '../containers/withCurrentUser.js';
|
|||
import withEdit from '../containers/withEdit.js';
|
||||
import { withApollo } from 'react-apollo';
|
||||
import { withCookies } from 'react-cookie';
|
||||
import moment from 'moment';
|
||||
|
||||
class App extends PureComponent {
|
||||
constructor(props) {
|
||||
|
@ -13,9 +14,9 @@ class App extends PureComponent {
|
|||
if (props.currentUser) {
|
||||
runCallbacks('events.identify', props.currentUser);
|
||||
}
|
||||
this.state = {
|
||||
locale: this.initLocale(),
|
||||
};
|
||||
const locale = this.initLocale();
|
||||
this.state = { locale };
|
||||
moment.locale(locale);
|
||||
}
|
||||
|
||||
initLocale = () => {
|
||||
|
@ -52,6 +53,7 @@ class App extends PureComponent {
|
|||
if (this.props.currentUser) {
|
||||
await this.props.editMutation({ documentId: this.props.currentUser._id, set: { locale }});
|
||||
}
|
||||
moment.locale(locale);
|
||||
this.props.client.resetStore()
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue