Commit Graph
7 Commits
Author SHA1 Message Date
seojcarlos dbcd51ac2c fix: guard toISOString against Invalid Date in Firefox
Wrap toISOString calls with try-catch to prevent TypeError when
date-fns-tz localToUtc returns Invalid Date in Firefox. Falls back
to the original pre-conversion date if conversion fails.
2026-04-12 09:45:43 +02:00
seojcarlos 816b51096d fix: guard toISOString calls against Invalid Date in Firefox
The previous fix guarded startAt/endAt numeric values but left
startDate/endDate calling .toISOString() on the potentially invalid
result of localToUtc(), which throws TypeError in Firefox when
zonedTimeToUtc returns Invalid Date. Now falls back to raw date
.toISOString() when the UTC conversion is invalid.
2026-04-08 08:22:16 +02:00
seojcarlos 2cd9657ae1 fix: prevent NaN timestamps from breaking event charts in Firefox
When date-fns-tz zonedTimeToUtc returns Invalid Date in Firefox,
the unary + operator produces NaN, which gets sent as "NaN" in
query parameters. Routes using z.coerce.number().int() validation
(events/series, event-data/properties) reject NaN as non-integer,
returning 400 errors and showing "Something went wrong".

This fix:
- Falls back to raw date timestamps when timezone conversion
  produces NaN in useDateParameters
- Filters out NaN values in getQueryString to prevent invalid
  parameters from reaching the server

Fixes #4121
2026-04-07 21:24:11 +02:00
Francis Cao 6751bf88bb fix chart and timezone issues, pass consistent dates to DB.
Closes #3700
2025-11-13 15:52:24 -08:00
Francis CaoandOm Mishra 839bf3898f add canonicalizeTimezone conversions
Co-authored-by: Om Mishra <contact@om-mishra.com>
2025-11-10 17:27:45 -08:00
Mike Cao 92ee44756c Refactored useDateRange to always use query string. Fixed all time filter. 2025-10-03 17:55:39 -07:00
Mike Cao cdf391d5c2 Refactor part 2: Electric Boogaloo. Standardize way of passing filter parameters. 2025-07-04 01:23:11 -07:00