diff options
Diffstat (limited to 'src/client/react/store')
-rw-r--r-- | src/client/react/store/selectors.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/react/store/selectors.js b/src/client/react/store/selectors.js index 8264cdb..2567107 100644 --- a/src/client/react/store/selectors.js +++ b/src/client/react/store/selectors.js @@ -1,5 +1,6 @@ import moment from 'moment'; import queryString from 'query-string'; +import isNaN from 'lodash/isNaN'; import purifyWeek from '../lib/purifyWeek'; import users from '../users'; @@ -21,8 +22,9 @@ export function selectCurrentWeek(store) { export function selectWeek(store) { const { location } = store.router; const weekStr = queryString.parse(location.search).week; + const week = parseInt(weekStr, 10); - if (!weekStr) { + if (isNaN(week)) { return selectCurrentWeek(store); } |