From d45f8d5dc7d258d9a1f61f09d704c669299bd82b Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Wed, 7 Jun 2017 18:04:34 -0700 Subject: [PATCH] Fixed dates. --- fabfile.py | 2 +- media/js/newsblur/models/stories.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fabfile.py b/fabfile.py index 74fdd6215..fb87b1db6 100644 --- a/fabfile.py +++ b/fabfile.py @@ -1479,7 +1479,7 @@ def role_for_host(): @parallel def deploy(fast=False, reload=False): role = role_for_host() - if role in ['work', 'search']: + if role in ['work', 'search', 'debug']: deploy_code(copy_assets=False, fast=fast, reload=True) else: deploy_code(copy_assets=False, fast=fast, reload=reload) diff --git a/media/js/newsblur/models/stories.js b/media/js/newsblur/models/stories.js index 653aaac8f..31c0e2c5e 100644 --- a/media/js/newsblur/models/stories.js +++ b/media/js/newsblur/models/stories.js @@ -71,7 +71,7 @@ NEWSBLUR.Models.Story = Backbone.Model.extend({ }; var midnight_tomorrow = function(midnight, days) { if (!days) days = 1; - return new Date(midnight + days*60*60*24*1000); + return new Date(midnight.getTime() + days*60*60*24*1000); }; var midnight_yesterday = function(midnight) { return midnight_tomorrow(midnight, -1); @@ -80,6 +80,7 @@ NEWSBLUR.Models.Story = Backbone.Model.extend({ var time = date.format(dateformat == "24" ? "H:i" : "g:ia"); if (date > midnight) { + console.log(['midnight', date, midnight_tomorrow(midnight), date > midnight_tomorrow(midnight)]); if (date > midnight_tomorrow(midnight)) { if (date < midnight_tomorrow(midnight, 2)) { return "Tomorrow, " + time; @@ -109,7 +110,7 @@ NEWSBLUR.Models.Story = Backbone.Model.extend({ }; var midnight_tomorrow = function(midnight, days) { if (!days) days = 1; - return new Date(midnight + days*60*60*24*1000); + return new Date(midnight.getTime() + days*60*60*24*1000); }; var midnight_yesterday = function(midnight) { return midnight_tomorrow(midnight, -1);