|
|
@ -20,17 +20,20 @@ define(
|
|
|
|
|
|
|
|
|
|
|
|
var date = Moment(sourceDate);
|
|
|
|
var date = Moment(sourceDate);
|
|
|
|
|
|
|
|
|
|
|
|
if (date.isAfter(Moment().add('days', 6))) {
|
|
|
|
var calendarDate = date.calendar();
|
|
|
|
return date.fromNow(true);
|
|
|
|
|
|
|
|
|
|
|
|
//TODO: It would be nice to not have to hack this...
|
|
|
|
|
|
|
|
var strippedCalendarDate = calendarDate.substring(0, calendarDate.indexOf(' at '));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (strippedCalendarDate){
|
|
|
|
|
|
|
|
return strippedCalendarDate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (date.isBefore(Moment().add('days', -6))) {
|
|
|
|
if (date.isAfter(Moment())) {
|
|
|
|
return date.fromNow();
|
|
|
|
return date.fromNow(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var calendarDate = date.calendar();
|
|
|
|
return date.fromNow();
|
|
|
|
//TODO: It would be nice to not have to hack this...
|
|
|
|
|
|
|
|
return calendarDate.substring(0, calendarDate.indexOf(' at '));
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
pad: function(n, width, z) {
|
|
|
|
pad: function(n, width, z) {
|
|
|
|