diff --git a/UI/Calendar/UpcomingItemView.js b/UI/Calendar/UpcomingItemView.js index 3411ae859..1419bbb20 100644 --- a/UI/Calendar/UpcomingItemView.js +++ b/UI/Calendar/UpcomingItemView.js @@ -3,16 +3,27 @@ define( [ 'app', - 'marionette' - ], function (App, Marionette) { + 'marionette', + 'moment' + ], function (App, Marionette, Moment) { return Marionette.ItemView.extend({ - template: 'Calendar/UpcomingItemTemplate', + template: 'Calendar/UpcomingItemViewTemplate', tagName : 'div', events: { 'click .x-episode-title': '_showEpisodeDetails' }, + initialize: function () { + var start = this.model.get('airDateUtc'); + var runtime = this.model.get('series').runtime; + var end = Moment(start).add('minutes', runtime); + + this.model.set({ + end: end + }) + }, + _showEpisodeDetails: function () { App.vent.trigger(App.Commands.ShowEpisodeDetails, {episode: this.model}); } diff --git a/UI/Calendar/UpcomingItemTemplate.html b/UI/Calendar/UpcomingItemViewTemplate.html similarity index 100% rename from UI/Calendar/UpcomingItemTemplate.html rename to UI/Calendar/UpcomingItemViewTemplate.html diff --git a/UI/Episode/Summary/LayoutTemplate.html b/UI/Episode/Summary/LayoutTemplate.html index a8c765b6c..1263ad98e 100644 --- a/UI/Episode/Summary/LayoutTemplate.html +++ b/UI/Episode/Summary/LayoutTemplate.html @@ -1,5 +1,4 @@