Skip to content

Support for season and season-0X in date-parts #198

@trackleft

Description

@trackleft

Description

The CSL JSON schema supports expressing seasons using:

  1. A dedicated season property (e.g. "season": 4)
  2. A seasonal token in date-parts (e.g. [2009, "season-04"])

Reference:
https://github.com/citation-style-language/schema/blob/master/schemas/input/csl-data.json

However, citeproc-php currently does not render either form correctly. If "season-0X" is used in date-parts, it is treated as an invalid or unknown month, and if season is set separately, it is ignored entirely.


Steps to Reproduce

Use the following CSL JSON input:

{
  "issued": {
    "date-parts": [[2009, "season-04"]],
    "season": 4
  }
}

With a CSL style such as:

<date variable="issued" form="text">
  <date-part name="month" suffix=" "/>
  <date-part name="year"/>
</date>

Expected output:

Winter 2009

Actual output:

Mar. 2009

Expected Behavior

The processor should interpret "season-04" as a valid placeholder in date-parts (like citeproc-js), and/or render the season property if date-parts does not contain a second value.


Environment

  • citeproc-php version: "seboettg/citeproc-php": "2.6.2"
  • PHP version: PHP 8.3.14

Proposed Fix

  • Add support for parsing "season-0X" tokens in date-parts, with localization via <term name="season-04">Winter</term> and related terms.
  • Optionally support the season property as a fallback or primary field when only the year is given.

This would bring citeproc-php into alignment with the CSL JSON specification and improve compatibility with existing citation processors like citeproc-js.

Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions