Better times for tasks when not using relative dates

pull/3113/head
Mark McDowall 10 years ago
parent bf169eb139
commit a5b09b8975

@ -17,19 +17,18 @@ define(
if (dateStr) { if (dateStr) {
var date = moment(dateStr); var date = moment(dateStr);
var result = '<span title="{0}">{1}</span>'; var result = '<span title="{0}">{1}</span>';
if (UiSettings.get('showRelativeDates')) {
var tooltip = date.format(UiSettings.longDateTime()); var tooltip = date.format(UiSettings.longDateTime());
var text = date.fromNow(); var text;
this.$el.html(result.format(tooltip, text)); if (UiSettings.get('showRelativeDates')) {
text = date.fromNow();
} }
else { else {
this.$el.html(date.format(UiSettings.longDateTime())); text = date.format(UiSettings.shortDateTime());
} }
this.$el.html(result.format(tooltip, text));
} }
return this; return this;

@ -26,17 +26,18 @@ define(
else { else {
var result = '<span title="{0}">{1}</span>'; var result = '<span title="{0}">{1}</span>';
if (UiSettings.get('showRelativeDates')) {
var tooltip = nextExecution.format(UiSettings.longDateTime()); var tooltip = nextExecution.format(UiSettings.longDateTime());
var text = nextExecution.fromNow(); var text;
this.$el.html(result.format(tooltip, text)); if (UiSettings.get('showRelativeDates')) {
text = nextExecution.fromNow();
} }
else { else {
this.$el.html(nextExecution.format(UiSettings.longDateTime())); text = nextExecution.format(UiSettings.shortDateTime());
} }
this.$el.html(result.format(tooltip, text));
} }
return this; return this;

Loading…
Cancel
Save