From cc4225db1a5dc446f658b77a53694fbff349bdeb Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 21 Aug 2021 05:59:49 -0400 Subject: [PATCH] Restore localized date in Styles list in Cite prefs With the new tree, this was showing the full timestamp from the style object. --- .../content/zotero/preferences/preferences_cite.jsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/preferences/preferences_cite.jsx b/chrome/content/zotero/preferences/preferences_cite.jsx index 745eb66745..ba157e4b7f 100644 --- a/chrome/content/zotero/preferences/preferences_cite.jsx +++ b/chrome/content/zotero/preferences/preferences_cite.jsx @@ -99,7 +99,7 @@ Zotero_Preferences.Cite = { dataKey: "updated", label: "zotero.preferences.cite.styles.styleManager.updated", fixedWidth: true, - width: 150 + width: 100 } ]; var handleKeyDown = (event) => { @@ -108,13 +108,20 @@ Zotero_Preferences.Cite = { return false; } }; + let styles = Zotero.Styles.getVisible() + .map((style) => { + return { + title: style.title, + updated: Zotero.Date.sqlToDate(style.updated, true).toLocaleDateString() + }; + }); let elem = ( Zotero.Styles.getVisible().length} + getRowCount={() => styles.length} id="styleManager-table" ref={ref => this._tree = ref} - renderItem={makeRowRenderer(index => Zotero.Styles.getVisible()[index])} + renderItem={makeRowRenderer(index => styles[index])} showHeader={true} multiSelect={true} columns={columns}