diff options
author | Christian Pointner <equinox@helsinki.at> | 2017-01-14 14:05:45 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2017-01-14 14:06:33 (GMT) |
commit | 77204deba25008b59dbf0f5387d0775c4f313d83 (patch) | |
tree | 381c4097121ef4ca55810f858e33c301aec5f72f /www/js/todo.js | |
parent | 7a8a7f30f2fc809bc3d2faa8c28bde9dec342098 (diff) |
date check
Diffstat (limited to 'www/js/todo.js')
-rw-r--r-- | www/js/todo.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/www/js/todo.js b/www/js/todo.js index 23768b7..dd9acb1 100644 --- a/www/js/todo.js +++ b/www/js/todo.js @@ -32,7 +32,7 @@ var shows = null; rh.ShowList = function(d) { this.$this = $(this); this.shows = []; - if((Object.prototype.toString.call(d) !== '[object Date]') || (d.toString() === 'Invalid Date')) { + if(!is_valid_date(d)) { this.current = new Date(); } else { this.current = d; @@ -59,8 +59,7 @@ rh.ShowList.prototype.fetch = function() { self.$this.trigger('update'); } }).fail(function() { - if((Object.prototype.toString.call(self.last_succeeded) === '[object Date]') && - (self.last_succeeded.toString() !== 'Invalid Date')) { + if(is_valid_date(self.last_succeeded)) { self.current = self.last_succeeded; self.current_week = get_rd_week(self.current.valueOf()); self.$this.trigger('update'); @@ -178,7 +177,7 @@ function todo_init() { var d = new Date(); if(url.path.length > 1) { var tmp = new Date(url.path[1]); - if((Object.prototype.toString.call(tmp) === '[object Date]') && (tmp.toString() !== 'Invalid Date')) { + if(is_valid_date(tmp)) { d = tmp; } } |