According to the CSL 1.0 spec:

The cs:date-part elements may carry attributes for both affixes and formatting, while cs:date may carry a delimiter (delimiting the various cs:date-part elements).

However, it looks like the delimiter attribute is currently being ignored by CiteProc on date elements. Biblio usually displays just the years instead of full dates, so I guess this is why this bug has not been reported before.
One can work around this bug using prefixes or suffixes, but that is not ideal.

Here's the CSL snippet I'm using to reproduce this bug:

        <date variable="accessed" delimiter=" ">
          <date-part name="day" form="numeric"/>
          <date-part name="month" form="long"/>
          <date-part name="year" form="long"/>
        </date>

And the output:

25mars2013

Note:
Biblio does not provide a "structured" access date field. In my particular case it is generated by the following code, in an override of theme_biblio_citeproc_style():

  $now = time();
  $node->biblio_access_date = array(
    format_date($now, 'custom', 'Y'),
    format_date($now, 'custom', 'n'),
    format_date($now, 'custom', 'j'),
  );

Comments

rjerome’s picture

Looks like line 1006 in csl_date::render() should be

$text = implode($this->delimiter, $date_parts);

rather than

$text = implode('', $date_parts);

Haven't actually tried it yet though.

rjerome’s picture

Status: Active » Fixed

OK, so I've confirmed that the above mentioned fix works, however looking through some other styles, I see that using suffixes is not out of the question, especially if you need different delimiters. Here is a snippet out of the ama.csl style...

              <date variable="accessed">
                  <date-part name="month" suffix=" "/>
                  <date-part name="day" suffix=", "/>
                  <date-part name="year"/>
               </date>

which produces... March 25, 2013

Ron.

http://drupalcode.org/project/biblio.git/commit/ba8ca0f

david lesieur’s picture

Nice! Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.