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