Test if issued date contains month and day
Is it possible to test in CSL (0.8 or 1.0) if a date variable contains all three components - year, month and day?
This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
Trochim, WM 2000, The research methods knowledge base, 2nd edn, updated 2 August 2000, viewed 14 November 2001, <http://socialresearchmethods.net/kb/index.htm>.
When there is no "day" information, since the month is placed just after a period, it has to be "capitalize-first", whereas when there is one, it has to be "lowercase".
I didn't understand how to use the fbennett's solution.
Would I dare asking for the coding lines to include in the style so as to obtain the right result? I would be very grateful.
I spent some time looking for a solution. The problem is that the "if" selector can only test if a "variable" is empty or not. That is, "if" cannot test if a "macro" is empty or not.
What we need is something like this:
<macro name="day-month">
<date variable="issued">
<date-part name="month"/>
<date-part name="day" prefix=" "/>
</date>
</macro>
<macro name="date-full">
<choose>
<if macro="day-month">
<date variable="issued">
<date-part name="month" suffix=" "/>
<date-part name="day" suffix=", "/>
<date-part name="year" />
</date>
</if>
</choose>
</macro>
Unfortunately, this code doesn't work because there's no such option as
<if macro="day-month"> ... </if>
I can't think of a solution after reading the CSL syntax summary. I think that we'll have to wait for a Zotero upgrade.Thanks,