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:
parent
ab868cc403
commit
bf62ab0d26
@ -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}}
|
||||
|
@ -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…
Reference in New Issue
Block a user