The numeric-leading-zeros of the day formats works incorrectly!
Here is a piece of code in a csl file:
<date variable="accessed" prefix="/">
<date-part name="year"/>
<date-part name="month" form="numeric-leading-zeros" prefix="-"/>
<date-part name="day" form="numeric-leading-zeros" prefix="-"/>
</date>
I want to get this format: 2009-03-03
However I got this: 2009-03-3
Can somebody help me to fix this? Thanks!
<date variable="accessed" prefix="/">
<date-part name="year"/>
<date-part name="month" form="numeric-leading-zeros" prefix="-"/>
<date-part name="day" form="numeric-leading-zeros" prefix="-"/>
</date>
I want to get this format: 2009-03-03
However I got this: 2009-03-3
Can somebody help me to fix this? Thanks!
if(form == "numeric-leading-zeros"
https://www.zotero.org/trac/browser/extension/branches/1.0/chrome/content/zotero/xpcom/cite.js#L1222
should become
if(newForm == "numeric-leading-zeros"
as 'newForm' instead of 'form' is used for the rest of the (working) date-formatting code, e.g.:
https://www.zotero.org/trac/browser/extension/branches/1.0/chrome/content/zotero/xpcom/cite.js#L1205
In Zotero 1.0.x, the file is cite.js; and in Zoteor 1.5.x, it's csl.js. All the modifications are from :
if(form == "numeric-leading-zeros"
&& string.length() == 1) {
to:
if(newForm == "numeric-leading-zeros"
&& string.length == 1) {
Thanks for your clarification.
The custom-made CSL which I am using causes the error from within the Zotero/OpenOffice.org:
"Zotero experienced an error updating your document
string.length is not a function"
This happens only if <date-part name="day" form="numeric-leading-zeros" prefix="/"/> is there in the CSL. Without the string "numeric-leading-zeros", the error does not occur.
In rc4, there was no such error message, but "numeric-leading-zeros" was just ignored like described above.
What to do?
https://www.zotero.org/trac/changeset/5725
http://www.developertutorials.com/tutorials/javascript/javascript-string-length-051019/page1.html