aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/store/selectors.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-07-06 17:34:06 +0200
committerNoah Loomans <noahloomans@gmail.com>2018-07-06 17:34:06 +0200
commit7bfb87a0beda7247f1edc687b34144859813758a (patch)
treeed2d4b3d81b13d14d631938f01c151113b940635 /src/client/react/store/selectors.js
parent53bb2628748e5967514251606d1fece9f4388b35 (diff)
client: Remove url helpers
Diffstat (limited to 'src/client/react/store/selectors.js')
-rw-r--r--src/client/react/store/selectors.js4
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);
}