Formatting a date
How do I format a date in a reference, based on which parts of day/month/year are present? I can't work out how to test on date-part.
Essentially, if the date is just given as 2008 I want "2008". If it's given as "02-2008" then I want "Feb. 2008" and if it's 26-02-2008 then I want 26th Feb 2008, so presumably I need to test on the presence of <date-part name="day"/> and <date-part name="month"/>. I can't work out how to do that test, and I can't find an example that puts more than the year in the reference.
Thanks in advance.
Essentially, if the date is just given as 2008 I want "2008". If it's given as "02-2008" then I want "Feb. 2008" and if it's 26-02-2008 then I want 26th Feb 2008, so presumably I need to test on the presence of <date-part name="day"/> and <date-part name="month"/>. I can't work out how to do that test, and I can't find an example that puts more than the year in the reference.
Thanks in advance.
<date-part name="day" suffix="th "/>
<date-part name="month" form="short" suffix=". "/>
<date-part name="year"/>
</date>