Skip to content

Add initial timestamp values into hour/minute/second inputs#3212

Open
Alex-Tideman wants to merge 4 commits intocodefreeze-03.02.26from
timestamp-save
Open

Add initial timestamp values into hour/minute/second inputs#3212
Alex-Tideman wants to merge 4 commits intocodefreeze-03.02.26from
timestamp-save

Conversation

@Alex-Tideman
Copy link
Collaborator

@Alex-Tideman Alex-Tideman commented Mar 5, 2026

Description & motivation 💭

When reopening a datetime filter chip (e.g., StartTime >= 3/5/26, 9:15:00 AM CST), the hour/minute/second inputs were empty instead of showing the previously set values.

Root cause: The dropdown-filter-chip.svelte component initialized its local time state to empty strings on every mount, never parsing the existing filter's ISO timestamp value back into date/time components.

Fix:

  • Parse the filter's stored UTC ISO value back into date, hour, minute, and second using utcToZonedTime to respect the user's selected timezone
  • Handles both single datetime (>=, <=) and BETWEEN range filters
  • Also fixed the "add new filter" flow (datetime-filter.svelte) to initialize from persisted stores so values carry over
  • Extracted parsing logic into a shared utility (datetime-filter-parse.ts) with 12 unit tests covering single datetime, BETWEEN ranges, timezone
    conversion, and edge cases

Screenshots (if applicable) 📸

Screenshot 2026-03-05 at 2 19 09 PM

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

Parse the existing filter ISO value back into date/time components
when reopening a datetime filter chip. Also initialize the "add new
filter" datetime inputs from persisted stores.
Move getInitialStart/getInitialEnd into a shared utility file
and add 12 unit tests covering single datetime, BETWEEN ranges,
timezone conversion, and edge cases.
@Alex-Tideman Alex-Tideman requested a review from rossedfort as a code owner March 5, 2026 20:25
@vercel
Copy link

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Mar 6, 2026 6:12pm

Request Review

@@ -0,0 +1,66 @@
import { startOfDay } from 'date-fns';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Could not find a declaration file for module 'date-fns-tz'. '/home/runner/work/ui/ui/node_modules/.pnpm/date-fns-tz@1.3.8_date-fns@2.30.0/node_modules/date-fns-tz/index.js' implicitly has an 'any' type.

@temporal-cicd
Copy link
Contributor

temporal-cicd bot commented Mar 5, 2026

Warnings
⚠️

📊 Strict Mode: 6 errors in 3 files (0.5% of 1110 total)

src/lib/utilities/query/datetime-filter-parse.ts (1)
  • L1:31: Could not find a declaration file for module 'date-fns-tz'. '/home/runner/work/ui/ui/node_modules/.pnpm/date-fns-tz@1.3.8_date-fns@2.30.0/node_modules/date-fns-tz/index.js' implicitly has an 'any' type.
src/lib/components/search-attribute-filter/datetime-filter.svelte (1)
  • L2:33: Could not find a declaration file for module 'date-fns-tz'. '/home/runner/work/ui/ui/node_modules/.pnpm/date-fns-tz@1.3.8_date-fns@2.30.0/node_modules/date-fns-tz/index.js' implicitly has an 'any' type.
src/lib/components/workflow/filter-bar/dropdown-filter-chip.svelte (4)
  • L4:33: Could not find a declaration file for module 'date-fns-tz'. '/home/runner/work/ui/ui/node_modules/.pnpm/date-fns-tz@1.3.8_date-fns@2.30.0/node_modules/date-fns-tz/index.js' implicitly has an 'any' type.
  • L316:12: Type 'null' is not assignable to type 'string'.
  • L65:4: Type 'null' is not assignable to type 'number'.
  • L192:24: Parameter 'e' implicitly has an 'any' type.

Generated by 🚫 dangerJS against ece80a5

@alexshtin
Copy link

Thanks for fixing this!

@@ -3,6 +3,7 @@

import { addHours, addMinutes, addSeconds, startOfDay } from 'date-fns';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Could not find a declaration file for module 'date-fns-tz'. '/home/runner/work/ui/ui/node_modules/.pnpm/date-fns-tz@1.3.8_date-fns@2.30.0/node_modules/date-fns-tz/index.js' implicitly has an 'any' type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants