Repository navigation
Let data-show-time turn time off as well as on - #19
Merged
Merged
Conversation
The attribute is write-only. The guard reads it, compares to "true", and assigns true; there is no branch that assigns false. So it can only ever add time, never remove it, and an input that wants dates inside a call that asked for datetimes has no way to say so. The fixture gains a pair outside .datetime_preset_pair, which the auto-init leaves alone, so the example can drive it with explicit options without a second "Set range" link getting in the way. This commit is expected to fail CI.
Assign the attribute's value rather than a bare true, so an element can opt out of a show_time its call or the defaults turned on. An absent attribute still inherits, so nothing that worked before changes. Unreachable before per-element options landed: show_time was shared across the whole call, so one element could not have differed from another anyway.
Fivell
force-pushed
the
fix/show-time-false
branch
from
October 1, 2026 11:00
31eea92 to
81fab99
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.
Follow-up to #13, which made
show_timeelement-scoped. This fixes the half that was never reachable before that landed.The bug
The attribute is write-only. The guard reads it, compares to
"true", and assignstrue. There is no branch that assignsfalse. Sodata-show-timecan only ever add time, never remove it.That matters as soon as
show_timeis on at a level above the element — either$.fn.date_range_ext_preset.defaults.show_time = true, which the README documents, or passed to the call:Every matched input now gets datetimes, and
data-show-time="false"on one of them is a no-op. There is no way to opt out.This was latent until #13: before it,
show_timewas shared across the whole call anyway, so one element could not have differed from another regardless.The fix
Make the attribute authoritative in both directions when it is present:
Absent attribute still inherits from the call and the defaults, so nothing that worked before changes.
The spec
The fixture gains an input wrapped in
manual_preset_pairrather thandatetime_preset_pair, so the plugin's auto-init leaves it alone and the example can call the plugin with{ show_time: true }without a second "Set range" link getting in the way.On the parent commit: