aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/schedule.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2017-09-04 20:12:23 +0200
committerNoah Loomans <noahloomans@gmail.com>2017-09-04 20:12:23 +0200
commite3947f0d11864f40a2c0a202af99e0b14ff14dcf (patch)
tree38d1eaa9509cafa616c13ec60481418e8c1dc4cd /public/javascripts/schedule.js
parent92a85bee3371702dd1a053dcc2f7bd8922802795 (diff)
Only show weeks that are available
Diffstat (limited to 'public/javascripts/schedule.js')
-rw-r--r--public/javascripts/schedule.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/public/javascripts/schedule.js b/public/javascripts/schedule.js
index a1ca647..73e2a54 100644
--- a/public/javascripts/schedule.js
+++ b/public/javascripts/schedule.js
@@ -1,3 +1,5 @@
+/* global VALID_WEEK_NUMBERS */
+
const EventEmitter = require('events')
const leftPad = require('left-pad')
const search = require('./search')
@@ -55,6 +57,10 @@ self._removeChilds = function () {
}
self.viewItem = function (week, selectedUser) {
+ if (VALID_WEEK_NUMBERS.indexOf(week) === -1) {
+ self._handleError({ target: { status: 404 } });
+ return
+ }
const url = self._getURLOfUsers(week, selectedUser.type, selectedUser.index)
self._removeChilds()