Exposed Filters params cause invaild date on load

Created on 18 March 2025, about 2 months ago

Problem/Motivation

When the FullCalendar block was loaded with URL parameters (like view filters), but without a valid date parameter, the calendar would incorrectly default to December 1969 (near Unix epoch 0) instead of the current date.

When processing URL parameters, the code attempted to create a date from the startParam value even when it was present but empty or invalid. This resulted in an invalid Date object that, when converted to a timestamp, was interpreted as December 1969.

Steps to reproduce

1. Have a full calendar view with exposed filters see https://www.drupal.org/project/fullcalendar_block/issues/3394725#comment... πŸ’¬ Support for exposed filters? Active

2. When exposed filters added like /calendar/month?field_event_collection_target_id=96 see how initial display shows Decemeber 1969

Proposed resolution

Proper validation before attempting to create a Date object:

Checks if the startParam value exists in the URL
Verifies the value is not empty after trimming
Only then attempts to parse it as a date
Only sets initialDate if a valid date was created

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States NicholasS

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024