Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set ISO date in itemFromCSLJSON() #14

Open
dstillman opened this issue Jun 24, 2022 · 0 comments
Open

Set ISO date in itemFromCSLJSON() #14

dstillman opened this issue Jun 24, 2022 · 0 comments
Assignees

Comments

@dstillman
Copy link
Member

dstillman commented Jun 24, 2022

For some reason we're using Zotero.Date.formatDate(), but I believe we use strToISO() in most site translators these days. Any reason not to change this?

var item = new Zotero.Item()
Zotero.Utilities.Item.itemFromCSLJSON(
    item,
    {
        type: 'article',
        "issued": {
        	"date-parts": [[ 2000, 3, 15 ]]
        }
        
    }
)
item
{
    "key": null,
    "version": null,
    "itemType": "preprint",
    "date": "March 15, 2000",
    "creators": [],
    "tags": [],
    "collections": [],
    "relations": {}
}

This resulted in a Chinese month being set ("四月 26, 2010") from ACM based on the browser locale:

https://forums.zotero.org/discussion/97683/bug-locale-issues-concerning-zotero-and-zotero-connector

(There was a separate parsing bug there that's been fixed.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants