Skip to content

Conversation

@shaneeza
Copy link
Collaborator

@shaneeza shaneeza commented Dec 15, 2025

✍️ Proposed changes

🎟 Jira ticket: Name of ticket

This PR implements state management for time input segments and the AM/PM select unit. The changes introduce useTimeSegmentsAndSelectUnit(open to improving this name) hook to manage time segment state, select unit state, and coordinate updates between them while handling timezone and locale changes.

This PR is the fourth PR in a chain of PRs

  1. [LG-5538] feat(time-input): Parse time #3378
  2. [LG-5532] feat(time-input) display segment values #3379
  3. [LG-5532] feat(time-input): Segment state utils #3385
  4. This PR
  5. [LG-5532] feat(time-input): Segment misc #3387

🧪 How to test changes

…cale dependency and enhancing formatting logic
…kMode and size, and add console log for debugging in TimeInputInputs
…omponent, covering rendering, value updates, and keyboard interactions
…omponent, covering rendering, value updates, and keyboard interactions
…12HourFormat prop, replacing TimeSegments with TimeSegment for improved clarity and consistency
…mponents with UTC conversion and logging for better time handling
…alidation and date handling logic, including new utility functions for explicit segment checks
…n TimeInputInputs, removing unnecessary console logs and enhancing segment checks
…ime change checks for improved clarity and accuracy
… segment validation and date handling, enhancing utility functions for better clarity and performance
…d 24 hour formats, improving clarity on explicit value checks and segment validation
…across components, enhancing clarity and organization
…ate and segment updates, enhancing clarity in handling locale and timezone changes
…fygreen-ui into LG-5532/segments-display-values-state
…ting setSegment logic and cleaning up imports
…eparating date and segment change effects for improved clarity and functionality
…SegmentsAndSelectUnit for better clarity on date update logic
…TimeSegmentValidator for clarity and update its usage in isEverySegmentValueExplicit
…ce getNewUTCDateFromSegments logic for better clarity
…and adjust related logic in TimeInputInputs and getFormattedDateTimeParts
…t handling and update getNewUTCDateFromSegments to utilize it
…proving comments and consistency in date conversions
…and isSameUTCMonth.spec for better clarity and consistency
…imeSegmentAndSelectUnit.spec for improved clarity and consistency
Base automatically changed from LG-5532/segments-state-utils to shaneeza/segment-logic-integration December 31, 2025 15:40
@github-actions
Copy link
Contributor

Coverage after merging LG-5532/segments-display-values-state into shaneeza/segment-logic-integration will be

79.48%

Coverage Report for Changed Files
FileStmtsBranchesFuncsLinesUncovered Lines
packages/time-input/src/TimeInputInputs
   TimeInputInputs.tsx100%100%100%100%
packages/time-input/src/hooks/useTimeSegmentsAndSelectUnit
   useTimeSegmentsAndSelectUnit.ts100%100%100%100%
packages/time-input/src/hooks/useTimeSegmentsAndSelectUnit/utils
   timeSegmentsAndSelectUnitReducer.ts81.82%75%100%83.33%14, 38
packages/time-input/src/hooks/useTimeSegmentsAndSelectUnit/utils/getInitialState
   getInitialState.ts100%100%100%100%

@shaneeza shaneeza requested a review from TheSonOfThomp January 6, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants