mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 17:13:49 -07:00
Only show date in upcoming when its not an episode for today
This commit is contained in:
parent
ab868cc403
commit
bf62ab0d26
2 changed files with 25 additions and 1 deletions
|
@ -71,4 +71,28 @@ define(
|
|||
|
||||
return moment(input).format('h:mm:ss A');
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('if_today', function(context, options) {
|
||||
var date = moment(context).startOf('day');
|
||||
var today = moment().startOf('day');
|
||||
|
||||
|
||||
if (date.isSame(today)) {
|
||||
return options.fn(this);
|
||||
}
|
||||
|
||||
return options.inverse(this);
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('unless_today', function(context, options) {
|
||||
var date = moment(context).startOf('day');
|
||||
var today = moment().startOf('day');
|
||||
|
||||
|
||||
if (date.isSame(today)) {
|
||||
return options.inverse(this);
|
||||
}
|
||||
|
||||
return options.fn(this);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue