Skip to content

Commit

Permalink
Merge pull request #2163 from HSLdevcom/timezone
Browse files Browse the repository at this point in the history
Set default timezone in server rendering
  • Loading branch information
vesameskanen authored Feb 21, 2018
2 parents 44bf9c8 + ac76628 commit fbe7471
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 };
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit fbe7471

Please sign in to comment.