From 92e9dc6ee1f33d8fc6361d00862778ab6711b032 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Wed, 11 Jan 2017 22:39:07 +0100 Subject: [PATCH] Fix sorting of unkown release date. --- src/UI/Cells/InCinemasCell.js | 2 +- src/UI/Movies/MoviesCollection.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/UI/Cells/InCinemasCell.js b/src/UI/Cells/InCinemasCell.js index ae4c337ed..9f1cb2d57 100644 --- a/src/UI/Cells/InCinemasCell.js +++ b/src/UI/Cells/InCinemasCell.js @@ -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")); diff --git a/src/UI/Movies/MoviesCollection.js b/src/UI/Movies/MoviesCollection.js index 16d50298f..44957debd 100644 --- a/src/UI/Movies/MoviesCollection.js +++ b/src/UI/Movies/MoviesCollection.js @@ -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');