mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Calendar now using EpisodeResource
This commit is contained in:
@@ -8,11 +8,56 @@ define(['app'], function () {
|
||||
},
|
||||
paddedEpisodeNumber: function () {
|
||||
return this.get('episodeNumber');
|
||||
},
|
||||
allDay : function () {
|
||||
return false;
|
||||
},
|
||||
day : function () {
|
||||
return Date.create(this.get('airDate')).format('{dd}');
|
||||
},
|
||||
month : function () {
|
||||
return Date.create(this.get('airDate')).format('{MON}');
|
||||
},
|
||||
startTime : function () {
|
||||
var start = Date.create(this.get('airDate'));
|
||||
|
||||
if (start.format('{mm}') === '00') {
|
||||
return start.format('{h}{tt}');
|
||||
}
|
||||
|
||||
return start.format('{h}.{mm}{tt}');
|
||||
},
|
||||
start : function () {
|
||||
return this.get('airDate');
|
||||
},
|
||||
end : function () {
|
||||
return this.get('endTime');
|
||||
},
|
||||
statusLevel : function () {
|
||||
var status = this.get('status');
|
||||
var currentTime = Date.create();
|
||||
var start = Date.create(this.get('start'));
|
||||
var end = Date.create(this.get('end'));
|
||||
|
||||
if (currentTime.isBetween(start, end)) {
|
||||
return 'warning';
|
||||
}
|
||||
|
||||
if (start.isBefore(currentTime) || status === 'Missing') {
|
||||
return 'danger';
|
||||
}
|
||||
|
||||
if (status === 'Ready') {
|
||||
return 'success';
|
||||
}
|
||||
|
||||
return 'primary';
|
||||
}
|
||||
},
|
||||
|
||||
defaults: {
|
||||
seasonNumber: 0
|
||||
seasonNumber: 0,
|
||||
status: 0
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user