commit ab9ae36135f0e9e34739fc99d6832341734f35a0 parent 02659cdde64bc0be7592e90eb4fab771f8340dc8 Author: Dan Stillman <dstillman@zotero.org> Date: Tue, 12 Apr 2011 14:47:44 +0000 Fix date-based sorting in reports Diffstat:
| M | components/zotero-protocol-handler.js | | | 11 | +++++++++-- |
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/components/zotero-protocol-handler.js b/components/zotero-protocol-handler.js @@ -417,9 +417,16 @@ function ChromeExtensionHandler() { valA = Zotero.Items.getSortTitle(valA); valB = Zotero.Items.getSortTitle(valB); } + // Use multipart date -- would be better just to get + // the unformatted date value directly, but toArray(), + // which we currently use above, doesn't do that + else if (sorts[index].field == 'date') { + valA = Zotero.Date.strToMultipart(a[sorts[index].field]); + valB = Zotero.Date.strToMultipart(b[sorts[index].field]); + } else { - var valA = a[sorts[index].field]; - var valB = b[sorts[index].field]; + valA = a[sorts[index].field]; + valB = b[sorts[index].field]; } // Put empty values last