mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-31 22:20:12 +00:00
Fixed dates.
This commit is contained in:
parent
f24e61a608
commit
d45f8d5dc7
2 changed files with 4 additions and 3 deletions
2
fabfile.py
vendored
2
fabfile.py
vendored
|
@ -1479,7 +1479,7 @@ def role_for_host():
|
||||||
@parallel
|
@parallel
|
||||||
def deploy(fast=False, reload=False):
|
def deploy(fast=False, reload=False):
|
||||||
role = role_for_host()
|
role = role_for_host()
|
||||||
if role in ['work', 'search']:
|
if role in ['work', 'search', 'debug']:
|
||||||
deploy_code(copy_assets=False, fast=fast, reload=True)
|
deploy_code(copy_assets=False, fast=fast, reload=True)
|
||||||
else:
|
else:
|
||||||
deploy_code(copy_assets=False, fast=fast, reload=reload)
|
deploy_code(copy_assets=False, fast=fast, reload=reload)
|
||||||
|
|
|
@ -71,7 +71,7 @@ NEWSBLUR.Models.Story = Backbone.Model.extend({
|
||||||
};
|
};
|
||||||
var midnight_tomorrow = function(midnight, days) {
|
var midnight_tomorrow = function(midnight, days) {
|
||||||
if (!days) days = 1;
|
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) {
|
var midnight_yesterday = function(midnight) {
|
||||||
return midnight_tomorrow(midnight, -1);
|
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");
|
var time = date.format(dateformat == "24" ? "H:i" : "g:ia");
|
||||||
|
|
||||||
if (date > midnight) {
|
if (date > midnight) {
|
||||||
|
console.log(['midnight', date, midnight_tomorrow(midnight), date > midnight_tomorrow(midnight)]);
|
||||||
if (date > midnight_tomorrow(midnight)) {
|
if (date > midnight_tomorrow(midnight)) {
|
||||||
if (date < midnight_tomorrow(midnight, 2)) {
|
if (date < midnight_tomorrow(midnight, 2)) {
|
||||||
return "Tomorrow, " + time;
|
return "Tomorrow, " + time;
|
||||||
|
@ -109,7 +110,7 @@ NEWSBLUR.Models.Story = Backbone.Model.extend({
|
||||||
};
|
};
|
||||||
var midnight_tomorrow = function(midnight, days) {
|
var midnight_tomorrow = function(midnight, days) {
|
||||||
if (!days) days = 1;
|
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) {
|
var midnight_yesterday = function(midnight) {
|
||||||
return midnight_tomorrow(midnight, -1);
|
return midnight_tomorrow(midnight, -1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue