Fix date-based sorting in reports
This commit is contained in:
parent
02659cdde6
commit
ab9ae36135
1 changed files with 9 additions and 2 deletions
|
@ -417,9 +417,16 @@ function ChromeExtensionHandler() {
|
||||||
valA = Zotero.Items.getSortTitle(valA);
|
valA = Zotero.Items.getSortTitle(valA);
|
||||||
valB = Zotero.Items.getSortTitle(valB);
|
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 {
|
else {
|
||||||
var valA = a[sorts[index].field];
|
valA = a[sorts[index].field];
|
||||||
var valB = b[sorts[index].field];
|
valB = b[sorts[index].field];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put empty values last
|
// Put empty values last
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue