1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 15:32:31 +01:00

Only show date in upcoming when its not an episode for today

This commit is contained in:
Mark McDowall 2014-12-23 20:03:57 -08:00
parent ab868cc403
commit bf62ab0d26
2 changed files with 25 additions and 1 deletions

View File

@ -8,7 +8,7 @@
<h4>{{title}}</h4>
</a>
{{/with}}
<p>{{StartTime airDateUtc}} {{ShortDate airDateUtc}}</p>
<p>{{StartTime airDateUtc}} {{#unless_today airDateUtc}}{{ShortDate airDateUtc}}{{/unless_today}}</p>
<p>
<span class="episode-title x-episode-title">
{{title}}

View File

@ -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);
});
});