1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-29 04:12:18 -05:00
This commit is contained in:
Tankred Hase 2013-03-21 20:28:10 +01:00
parent 5b98cd692a
commit 7758b144dc

View File

@ -45,7 +45,7 @@ app.dao.LawnchairDAO = function(window) {
* @param num [Number] The number of items to fetch (null means fetch all)
*/
this.list = function(type, offset, num, callback) {
var i, list = [], matchingKeys =[];
var i, list = [], matchingKeys =[], parts, date;
Lawnchair(function() {
var self = this;
@ -75,8 +75,8 @@ app.dao.LawnchairDAO = function(window) {
// sort items by date
if (list[0].sentDate) {
list = _.sortBy(list, function(item) {
var parts = item.sentDate.match(/(\d+)/g);
var date = new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);
parts = item.sentDate.match(/(\d+)/g);
date = new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);
return date.getTime();
});
}