Skip to content

Commit 2fa1f4f

Browse files
committed
feat: add Zotero date initialization
1 parent c66acb4 commit 2fa1f4f

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"sources/sandboxManager.js",
8787
"sources/zotero-utilities/openurl.js",
8888
"sources/zotero-utilities/date.js",
89+
"sources/zotero-utilities/resource/dateFormats.json",
8990
"sources/zotero-utilities/xregexp-all.js",
9091
"sources/zotero-utilities/xregexp-unicode-zotero.js",
9192
"sources/zotero-utilities/utilities.js",

sources/setupZotero.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,11 @@ if (browser.webRequest) {
2323
// webRequest is not available some contexts, so check before initializing
2424
Zotero.WebRequestIntercept.init();
2525
}
26+
27+
Zotero.Date.init(
28+
JSON.parse(
29+
await (
30+
await fetch(new URL("./zotero-utilities/resource/dateFormats.json", import.meta.url))
31+
).text(),
32+
),
33+
);

sources/setupZoteroPlain.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
globalThis.Zotero = {
22
isConnector: true,
33
isBrowserExt: true,
4+
locale: "en-US",
45
logError: console.error,
56
debug: console.debug,
67
Prefs: {

0 commit comments

Comments
 (0)