mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
removed backbone from VS solution,
renamed NzbDrone.Backbone to UI
This commit is contained in:
parent
c7776f74e1
commit
663160c06a
230 changed files with 57 additions and 386 deletions
51
UI/Calendar/CalendarModel.js
Normal file
51
UI/Calendar/CalendarModel.js
Normal file
|
@ -0,0 +1,51 @@
|
|||
define(['app'], function (app) {
|
||||
NzbDrone.Calendar.CalendarModel = Backbone.Model.extend({
|
||||
mutators: {
|
||||
title: function () {
|
||||
return this.get('seriesTitle');
|
||||
},
|
||||
allDay: function(){
|
||||
return false;
|
||||
},
|
||||
day: function() {
|
||||
return Date.create(this.get('start')).format('{dd}');
|
||||
},
|
||||
month: function(){
|
||||
return Date.create(this.get('start')).format('{MON}');
|
||||
},
|
||||
startTime: function(){
|
||||
var start = Date.create(this.get('start'));
|
||||
|
||||
if (start.format('{mm}') === '00')
|
||||
return start.format('{h}{tt}');
|
||||
|
||||
return start.format('{h}.{mm}{tt}');
|
||||
},
|
||||
paddedEpisodeNumber: function(){
|
||||
return this.get('episodeNumber');
|
||||
},
|
||||
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';
|
||||
},
|
||||
bestDateString: function () {
|
||||
return bestDateString(this.get('start'));
|
||||
},
|
||||
},
|
||||
defaults: {
|
||||
status: 0
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue