mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-24 22:35:39 -04:00
Only show date in upcoming when its not an episode for today
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user