From 6227b24e94c564a7e61a53350876376d871a9253 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 21 Feb 2018 12:16:28 +0200 Subject: [PATCH 1/2] Set default timezone in server rendering --- app/server.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/server.js b/app/server.js index 3cd4be8cd6..49b3cfdf84 100644 --- a/app/server.js +++ b/app/server.js @@ -32,6 +32,7 @@ import LRU from 'lru-cache'; import appCreator from './app'; import translations from './translations'; import MUITheme from './MuiTheme'; +import configureMoment from './util/configure-moment'; // configuration import { getConfiguration } from './config'; @@ -196,6 +197,13 @@ export default function(req, res, next) { .getStore('MessageStore') .addConfigMessages(config); + const language = context + .getComponentContext() + .getStore('PreferencesStore') + .getLanguage(); + + configureMoment(language, config); + // required by material-ui const agent = req.headers['user-agent']; global.navigator = { userAgent: agent }; From ac7662831979cc213031cf2ed5f1c6b0f2b87ba6 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 21 Feb 2018 21:40:43 +1100 Subject: [PATCH 2/2] Update moment --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e24ea3f560..541e670255 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "lodash-es": "4.17.4", "lru-cache": "4.1.1", "material-ui": "0.20.0", - "moment": "2.19.4", + "moment": "2.20.1", "moment-timezone": "0.5.14", "mqtt": "2.15.0", "name-all-modules-plugin": "1.0.1",