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.
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.