From e37f413e19b188713f9aa865512ed3d7769fd0ae Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 5 Jun 2013 20:03:04 -0700 Subject: [PATCH] Default sort ordering. Upcoming won't obey the comparator though. --- UI/Calendar/CalendarCollection.js | 7 +++++-- UI/Series/SeriesCollection.js | 12 ++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/UI/Calendar/CalendarCollection.js b/UI/Calendar/CalendarCollection.js index b1daaf248..3309dde8c 100644 --- a/UI/Calendar/CalendarCollection.js +++ b/UI/Calendar/CalendarCollection.js @@ -3,8 +3,11 @@ define(['app', 'Series/EpisodeModel'], function () { NzbDrone.Calendar.CalendarCollection = Backbone.Collection.extend({ url : NzbDrone.Constants.ApiRoot + '/calendar', model : NzbDrone.Series.EpisodeModel, - comparator: function (model) { - return model.get('airDate'); + + comparator: function(model) { + var date = new Date(model.get('airDate')); + var time = date.getTime(); + return time; } }); }); \ No newline at end of file diff --git a/UI/Series/SeriesCollection.js b/UI/Series/SeriesCollection.js index 78df7bba8..cec7fadc0 100644 --- a/UI/Series/SeriesCollection.js +++ b/UI/Series/SeriesCollection.js @@ -4,17 +4,13 @@ define(['app', 'Series/SeriesModel'], function () { url : NzbDrone.Constants.ApiRoot + '/series', model: NzbDrone.Series.SeriesModel, - mode: 'client', + comparator: function(model) { + return model.get('title'); + }, state: { sortKey: "title", - order: -1, - pageSize: 1000000 - }, - - queryParams: { - sortKey: null, - order: null + order: -1 } }); });