feat: disable past dates in Pay Schedule first pay date picker#1410
Merged
feat: disable past dates in Pay Schedule first pay date picker#1410
Conversation
Adds minDate, maxDate, and isDateDisabled props to the DatePicker component adapter interface, and uses minDate on the Pay Schedule anchorPayDate field to prevent selection of past dates. Also adds Zod validation on anchorPayDate as a safety net for programmatic submissions. Resolves SDK-530 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Reuse existing formatDateToStringDate utility in dateToCalendarDate instead of duplicating date string formatting logic - Revert Zod schema validation for anchorPayDate — the UI constraint (minDate) is sufficient and adding validation would require dynamic schema for i18n support Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Regenerates component-inventory.md to include the new minDate, maxDate, and isDateDisabled props added to DatePickerProps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fetches company payment speed via usePaymentConfigsGet and renders the Pay Schedule first pay date description dynamically (1/2/4 days) instead of hardcoding "2 days". Falls back to 2 if unavailable. Uses i18next count-based pluralization for correct "day" vs "days". Partially addresses SDK-592 (Pay Schedule only; Off-Cycle Pay Period and Contractor Payments still have hardcoded copy) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use local date parts (getFullYear/getMonth/getDate) instead of formatDateToStringDate which uses toISOString (UTC). This prevents timezone-related off-by-one errors where evening times in US timezones would shift to the next day in UTC. - Return undefined instead of throwing on invalid dates, since minDate/maxDate come from external adapters and an invalid value should not crash rendering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds two test cases proving that formatDateToStringDate (which uses toISOString/UTC) can return a different calendar date than the user's local date. This documents the latent bug that motivated using local date extraction (getFullYear/getMonth/getDate) in dateToCalendarDate. Also includes auto-generated i18next type update for pluralized anchorPayDateDescription keys. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove conditional test cases that were used to locally prove the UTC timezone bug in formatDateToStringDate. As Steve noted, conditionals in tests are bad practice — these served their purpose as local proof and don't belong in the test suite. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
serikjensen
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
minDate,maxDate, andisDateDisabledprops on the DatePicker component adapterdateToCalendarDateuses local date methods instead of UTC-basedformatDateToStringDateto avoid timezone shift bugIdentical changes to #1311, rebased onto main from the upstream repo (not the fork) to resolve merge blocking.
Test plan
🤖 Generated with Claude Code