Skip to content

Timeline: smwtlposition marker is silently ignored when no timelinebands are configured #1114

Description

@gesinn-it-gea

Description

In formats/timeline/resources/ext.srf.timeline.js, smwMakeTimeline() builds the FullCalendar/SimileTimeline band(s) differently depending on whether any smwtlband markers were found:

  • When bandcount > 0, each band is created via Timeline.createBandInfo({ ..., date: position, ... }) (lines ~110–129), correctly honoring a smwtlposition marker parsed into position.
  • When bandcount === 0 (no timelinebands parameter set), the "default band" fallback at lines 136–145 builds its Timeline.createBandInfo({...}) call without a date option:
// default band
if ( bandcount === 0 ) {
    bandInfos[ 0 ] = Timeline.createBandInfo( {
        eventSource: eventSource,
        width: '100%',
        intervalUnit: Timeline.DateTime.MONTH,
        intervalPixels: 100,
        theme: theme
        // date: position  <-- missing
    } );
}

As a result, a smwtlposition marker (i.e. the timelineposition format parameter) has no effect whenever timelinebands is not configured — the timeline always opens at its default position instead of the requested one.

Steps to reproduce

Use {{#ask: ... |format=timeline |timelineposition=1970-01-01T00:00:00Z}} without setting timelinebands. The timeline ignores timelineposition and opens at today's date instead.

Expected behavior

The default band should also receive date: position, consistent with the bandcount > 0 branches.

Additional context

Found and pinned (without fixing) while adding node-qunit test coverage for this file in #1100 — see the test ext.srf.timeline.test.js > BUG: ignores the smwtlposition marker when no smwtlband is present (only the default band exists), which documents today's (incorrect) behavior so the suite doesn't fail until this is fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions