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.
Description
In
formats/timeline/resources/ext.srf.timeline.js,smwMakeTimeline()builds the FullCalendar/SimileTimeline band(s) differently depending on whether anysmwtlbandmarkers were found:bandcount > 0, each band is created viaTimeline.createBandInfo({ ..., date: position, ... })(lines ~110–129), correctly honoring asmwtlpositionmarker parsed intoposition.bandcount === 0(notimelinebandsparameter set), the "default band" fallback at lines 136–145 builds itsTimeline.createBandInfo({...})call without adateoption:As a result, a
smwtlpositionmarker (i.e. thetimelinepositionformat parameter) has no effect whenevertimelinebandsis 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 settingtimelinebands. The timeline ignorestimelinepositionand opens at today's date instead.Expected behavior
The default band should also receive
date: position, consistent with thebandcount > 0branches.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.