mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
New: Show time instead of date if event occurs/occurred today
Closes #808
This commit is contained in:
parent
0b219e1169
commit
9ffa28f17c
4 changed files with 29 additions and 7 deletions
|
@ -12,14 +12,19 @@ module.exports = NzbDroneCell.extend({
|
|||
|
||||
if (dateStr) {
|
||||
var date = moment(dateStr);
|
||||
var diff = date.diff(moment().zone(date.zone()).startOf('day'), 'days', true);
|
||||
var result = '<span title="{0}">{1}</span>';
|
||||
var tooltip = date.format(UiSettings.longDateTime());
|
||||
var text;
|
||||
|
||||
if (UiSettings.get('showRelativeDates')) {
|
||||
text = FormatHelpers.relativeDate(dateStr);
|
||||
if (diff > 0 && diff < 1) {
|
||||
text = date.format(UiSettings.time(true, false));
|
||||
} else {
|
||||
text = date.format(UiSettings.get('shortDateFormat'));
|
||||
if (UiSettings.get('showRelativeDates')) {
|
||||
text = FormatHelpers.relativeDate(dateStr);
|
||||
} else {
|
||||
text = date.format(UiSettings.get('shortDateFormat'));
|
||||
}
|
||||
}
|
||||
|
||||
this.$el.html(result.format(tooltip, text));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue