mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
Calendar now using EpisodeResource
This commit is contained in:
parent
0da2047ca5
commit
11cef70406
10 changed files with 61 additions and 93 deletions
|
@ -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
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue