Skip to content

Commit fbe7471

Browse files
authored
Merge pull request #2163 from HSLdevcom/timezone
Set default timezone in server rendering
2 parents 44bf9c8 + ac76628 commit fbe7471

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

app/server.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import LRU from 'lru-cache';
3232
import appCreator from './app';
3333
import translations from './translations';
3434
import MUITheme from './MuiTheme';
35+
import configureMoment from './util/configure-moment';
3536

3637
// configuration
3738
import { getConfiguration } from './config';
@@ -196,6 +197,13 @@ export default function(req, res, next) {
196197
.getStore('MessageStore')
197198
.addConfigMessages(config);
198199

200+
const language = context
201+
.getComponentContext()
202+
.getStore('PreferencesStore')
203+
.getLanguage();
204+
205+
configureMoment(language, config);
206+
199207
// required by material-ui
200208
const agent = req.headers['user-agent'];
201209
global.navigator = { userAgent: agent };

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"lodash-es": "4.17.4",
8585
"lru-cache": "4.1.1",
8686
"material-ui": "0.20.0",
87-
"moment": "2.19.4",
87+
"moment": "2.20.1",
8888
"moment-timezone": "0.5.14",
8989
"mqtt": "2.15.0",
9090
"name-all-modules-plugin": "1.0.1",

0 commit comments

Comments
 (0)