1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-25 10:22: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) * @param num [Number] The number of items to fetch (null means fetch all)
*/ */
this.list = function(type, offset, num, callback) { this.list = function(type, offset, num, callback) {
var i, list = [], matchingKeys =[]; var i, list = [], matchingKeys =[], parts, date;
Lawnchair(function() { Lawnchair(function() {
var self = this; var self = this;
@ -75,8 +75,8 @@ app.dao.LawnchairDAO = function(window) {
// sort items by date // sort items by date
if (list[0].sentDate) { if (list[0].sentDate) {
list = _.sortBy(list, function(item) { list = _.sortBy(list, function(item) {
var parts = item.sentDate.match(/(\d+)/g); parts = item.sentDate.match(/(\d+)/g);
var date = new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]); date = new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);
return date.getTime(); return date.getTime();
}); });
} }