Repository navigation
Conversation
…t their format createFromFormat() without «!» keeps the current clock time for every field the format leaves out, so a date-only picker saved «2026-10-06 02:45:40» — and the record's date column changed on every save although the user never touched it. The «!» prefix resets those fields. Laravel's «date» rule refuses a bare time («14:00»), yet timePicker() kept that rule: time-only pickers now validate as date_format:<their format>. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
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.
Two things found when moving an app's date and time fields to this field:
A date-only picker changes the record on every save.
parseToCarbon()usesCarbon::createFromFormat($format, …), and without the!prefix PHP fills every field the format leaves out with the current clock time:Y-m-d→2026-10-06 02:45:40. The dehydrated Carbon then differs from the stored2026-10-06 00:00:00,wasChanged('day')is true on every save, and anything hooked on that (in our case a «date moved» customer notice) fires although the user only edited another field. With'!'.$formata date-only value lands on midnight and a time-only value on the epoch date.Time-only pickers fail validation.
timePicker()keeps thedaterule (hasDate()stays true), and Laravel'sdaterule rejects a bare14:00(«must be a valid date»). Time pickers now validate asdate_format:<their format>instead.Tests cover both (dehydration to midnight,
H:ipassing and14:60failing).🤖 Generated with Claude Code