Add split range picker via rangeEnd() (RFC 0001)#153
Merged
Conversation
Introduce rangeEnd() so one range picker can hydrate, sync, and dehydrate separate start and end model attributes while keeping single-field array behaviour as the default.
Document datetime range usage, add tests for split datetime dehydration, and build split regex from format tokens so time components parse correctly.
Build range wire state from selectedDates in JS, avoid brute-force split for partial ranges when syncing ends_at, and add tests that assert end times are preserved.
Skip the state watcher feedback loop after picker updates and preserve range date order when enableTime is on, so end-before-start selections are not swapped by flatpickr.setDate().
Chronologically normalize range picker state in JS and PHP so same-day end-before-start selections save correctly, and add schema-mount tests that restore 100% coverage for the rangeEnd hydration and sync paths.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #153 +/- ##
============================================
Coverage 100.00% 100.00%
- Complexity 293 354 +61
============================================
Files 6 6
Lines 698 823 +125
============================================
+ Hits 698 823 +125 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
->rangeEnd('ends_at')so one range picker reads/writes separate start/end model attributes->time()and custom formats; end times are preserved on saveRFC
Closes RFC 0001.
API
Default single-field array behaviour is unchanged when
rangeEnd()is omitted.Test plan
vendor/bin/pest --coverage --min=96— 151 tests pass, 100% coverage->rangePicker()->rangeEnd('ends_at')->time(), select a datetime range, save, and confirm both columns persist with correct times