diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-07-06 17:34:06 +0200 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-07-06 17:34:06 +0200 |
commit | 7bfb87a0beda7247f1edc687b34144859813758a (patch) | |
tree | ed2d4b3d81b13d14d631938f01c151113b940635 /src/client/react/store | |
parent | 53bb2628748e5967514251606d1fece9f4388b35 (diff) |
client: Remove url helpers
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); } |