Add DateTime min/max cross-validation and generalize minExceedsMax#733
Merged
alistair3149 merged 1 commit intomasterfrom Apr 20, 2026
Merged
Add DateTime min/max cross-validation and generalize minExceedsMax#733alistair3149 merged 1 commit intomasterfrom
alistair3149 merged 1 commit intomasterfrom
Conversation
14b8a71 to
886bd40
Compare
ec06904 to
d98d17e
Compare
7dba00b to
23a6a01
Compare
Fixes #730 `DateTimeAttributesEditor.vue` now refuses to emit an update when the minimum timestamp exceeds the maximum and surfaces the existing `neowiki-property-editor-min-exceeds-max` message on the offending field, matching the behavior the number editor already had. The comparison is a local 6-line helper that parses each input via `Date.parse` and treats empty or unparseable input as "no value" so typos don't produce spurious range errors. I considered generalizing the existing `minExceedsMax` helper to take a parser callback (the original plan in #730), but that turned out to be net-negative: the two existing consumers (`NumberAttributesEditor`, `TextAttributesEditor`) both already reduce to `Number(...)`, so the generalization parameterized a variation that didn't actually vary between current consumers, while adding indirection at every call site. Keeping the shared helper untouched and inlining DateTime's check reads more simply. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
23a6a01 to
86aa1be
Compare
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.
Fixes #730
DateTimeAttributesEditor.vuenow refuses to emit an update when theminimum timestamp exceeds the maximum and surfaces the existing
neowiki-property-editor-min-exceeds-maxmessage on the offendingfield, matching the behavior the number editor already had.
The comparison is a local 6-line helper that parses each input via
Date.parseand treats empty or unparseable input as "no value" sotypos don't produce spurious range errors. I considered generalizing
the existing
minExceedsMaxhelper to take a parser callback (theoriginal plan in #730), but that turned out to be net-negative: the
two existing consumers (
NumberAttributesEditor,TextAttributesEditor)both already reduce to
Number(...), so the generalizationparameterized a variation that didn't actually vary between current
consumers, while adding indirection at every call site. Keeping the
shared helper untouched and inlining DateTime's check reads more
simply.