If condition to choose full date (dmy) or just the year (y)
I am trying to build a CSL style for the Argentinean legal community (I know Juris-M, but I am opting for a CSL file because I use pandoc > biblatex > latex to work, and Juris-M works with citeproc-js instead of pandoc-citeproc).
I am facing an issue, however, with an IF CONDITION to print it one way if the variable "number" is present and ELSE if the value is absent. The strange thing is the following: it does work with my workflow (pandoc > biblatex > latex > pdf), and it works in the [visual editor](https://editor.citationstyles.org/visualEditor/). But it does not work in Zotero.
1. Any idea why that might be the case?
2. Is there a better alternative to achieve this result than using an IF CONDITION that depends on the presence / absence of a variable? (it is sort of a rough hack)
I am facing an issue, however, with an IF CONDITION to print it one way if the variable "number" is present and ELSE if the value is absent. The strange thing is the following: it does work with my workflow (pandoc > biblatex > latex > pdf), and it works in the [visual editor](https://editor.citationstyles.org/visualEditor/). But it does not work in Zotero.
1. Any idea why that might be the case?
2. Is there a better alternative to achieve this result than using an IF CONDITION that depends on the presence / absence of a variable? (it is sort of a rough hack)
<choose>
<if match="all" variable="number">
<date form="text" variable="issued" text-case="sentence" prefix=". Sentencia del ">
<date-part name="year" text-case="lowercase"/>
</date>
</if>
<else>
<date date-parts="year" form="numeric" variable="issued" prefix=" (" suffix=")"/>
</else>
</choose>
With that said, I’m not following what your specific problem is. “number” is available in all CSL styles and processors.
What style are you using? Can you provide your style and the exact citation data you are using? What output are you getting in Zotero and in pandoc?
It's still being developed, but the CSL file is now on https://github.com/ramiroau/gacl
I met a challenge I cannot solve.
I would like to distinguish the way the date of judicial decisions is presented, depending of the presence of a Docket Number in the Zotero item / CSL JSON item / .bib file.
In cases where the number is present, I would like the date to be presented in full and with "Sentencia del" as preffix:
Sentencia del 10 de mayo de 2020.
When the number is absent, I would like the date to include only the year, between brackets.
(2020).
I have managed to achieve this through a conditional in the visual editor. Relevant code between lines 249-262 (I am pasting this snippet below). Now the point where I am stuck:
1. The code works as expected in the CSL visual editor.
2. The code works as expected using Pandoc processing from a bib file.
3. The code **does not work as expected** in the Zotero connector for Libre Office and/or Word.
In the latter case (3), when number is present the date should be printed (2020) but instead it is printed Sentencia del 2020. I hope this explains
<choose>
<if match="all" variable="number">
<date form="text" variable="issued" text-case="sentence" prefix=". Sentencia del ">
<date-part name="day" range-delimiter="" text-case="lowercase"/>
<date-part name="month" range-delimiter=""/>
<date-part name="year" range-delimiter=""/>
</date>
</if>
<else>
<date date-parts="year" form="numeric" variable="issued" prefix=" (" suffix=")">
<date-part name="year"/>
</date>
</else>
</choose>
Example of citation data (in CSL JSON)
[
{
"id": "csjn2018d",
"type": "legal_case",
"authority": "Corte Suprema de Justicia de la Nación",
"title": "Gómez, Lucila Nélida s/ amparo",
"title-short": "CSJN",
"author": [
{
"literal": "CSJN"
}
],
"issued": {
"date-parts": [
[
"2018",
11,
13
]
]
}
}
]
<date-part name="year"/>
?</date>
While technically valid, there's almost never a reason to include the date-part on a localized date and it's so rare that it's possible it triggers a bug on the affixes.