Fix sorting of unkown release date.

This commit is contained in:
Leonardo Galli 2017-01-11 22:39:07 +01:00
parent 5e8b617625
commit 92e9dc6ee1
2 changed files with 12 additions and 1 deletions

View File

@ -8,7 +8,7 @@ module.exports = TemplatedCell.extend({
"July", "August", "September", "October", "November", "December"
];
this.$el.html("To be announced");
this.$el.html("");
if (this.model.get("inCinemas")) {
var cinemasDate = new Date(this.model.get("inCinemas"));

View File

@ -100,7 +100,18 @@ var Collection = PageableCollection.extend({
return percentOfEpisodes + episodeCount / 1000000;
}
},
inCinemas : {
sortValue : function(model, attr) {
var monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
];
if (model.get("inCinemas")) {
return model.get("inCinemas");
}
return "2100-01-01";
}
},
path : {
sortValue : function(model) {
var path = model.get('path');