EU Parliament Monitor — API Documentation - v0.9.24
    Preparing search index...

    Module Aggregator/Metadata/DateLabels

    Pure date-label derivation helpers extracted from article-metadata.ts as a leaf module in the metadata/ bounded context. Every helper takes an ISO YYYY-MM-DD string and returns a human-friendly label (or {start, end} window) used by the per-article-type template-fallback title generators.

    Bounded-context rules for this file:

    • No upward imports — pure helpers, no dependencies on other src/aggregator/ modules, no I/O, no globals.
    • Deterministic — same input always produces same output; safe to call from property-based tests.
    • UTC-only — all parsing/formatting goes through Date UTC accessors, never local-time getMonth()/getDate().

    Cross-references:

    • EP-term boundary constants follow analysis/methodologies/electoral-cycle-methodology.md.
    • The D-36 → D-8 reporting window for week-in-review follows ADR-006 (EP roll-call publication lag).

    Functions

    parseIsoDate
    formatIsoDate
    deriveWeekRange
    deriveReportingWindowForWeekInReview
    deriveMonthLabel
    deriveQuarterLabel
    deriveYearLabel
    deriveTermLabel
    deriveElectionCycleLabel

    Variables

    MS_PER_DAY
    EP10_START_YEAR
    EP10_END_YEAR
    EP11_END_YEAR
    EP_ELECTION_MONTH