From fe48fd9fe938673a87a7501a865c1226b22c5697 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 17 Jul 2013 17:28:33 -0700 Subject: [PATCH] Fixed DateCells --- UI/Cells/AirDateCell.js | 5 ++--- UI/Shared/FormatHelpers.js | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/UI/Cells/AirDateCell.js b/UI/Cells/AirDateCell.js index f48d40730..e40aa06fb 100644 --- a/UI/Cells/AirDateCell.js +++ b/UI/Cells/AirDateCell.js @@ -14,10 +14,9 @@ define( var date = this.model.get(this.column.get('name')); if (date) { - this.$el.html(FormatHelpers.DateHelper(date)); + this.$el.html('
' + FormatHelpers.DateHelper(date) + '
'); - //TODO: Figure out why this makes the series grid freak out - //this.$el.attr('title', Moment(date).format('LLLL')); + this.$el.children('div').attr('title', Moment(date).format('LLLL')); } return this; diff --git a/UI/Shared/FormatHelpers.js b/UI/Shared/FormatHelpers.js index c3d04a4bc..179446246 100644 --- a/UI/Shared/FormatHelpers.js +++ b/UI/Shared/FormatHelpers.js @@ -24,8 +24,12 @@ define( return date.fromNow(true); } - //TODO: It would be nice to not have to hack this... + if (date.isBefore(Moment().add('days', -6))) { + return date.fromNow(); + } + var calendarDate = date.calendar(); + //TODO: It would be nice to not have to hack this... return calendarDate.substring(0, calendarDate.indexOf(' at ')); },