Improved datetime selector - #351
Open
NiCADitO wants to merge 2 commits into
Open
Conversation
- Refresh the calendar's flagged days in setModelData so they follow the file filter - Remove the unused defaultValue property and reset() from DateTimeSelector - Guard the crossing push so a single edit runs one filter pass instead of two - Reorder the minute nudge buttons so the positive row mirrors the negative row
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.
The time filter's start and end fields pair a
JXDatePickerwith three spinners forhour, minute, and second, so setting a bound means clicking through a cluster of small
arrow buttons, and the field still never shows the milliseconds that log events carry.
This replaces that stack with a single reusable
DateTimeSelectorinutils/: onefield showing the full timestamp, plus a popup where a scrollable list of times does
most of what the spinner buttons used to, alongside a calendar and a few jump and nudge
buttons. Days containing events are flagged in the calendar, Start and End can no longer
cross, and the field parses the
uuuu-MM-dd HH:mm:ss:SSSformat used elsewhere inKindling, so a timestamp copied from the log table pastes straight in.
Changes
utils/DateTimeSelector.kt.DateTimeSelector,TimeSelector,TimePartSpinner,ChronoSpinnerModelandZonedDateTime.toDate()fromTimePanel.kt.setModelDatanow refreshes the flagged days, so the calendar follows the file filter.Timezone.Default.zoneIdat eachuse rather than caching it, and re-renders when the preference changes.
Testing
./gradlew buildon JDK 21.Note
Picking from the time list zeroes seconds and milliseconds, since it steps in five minute
increments. Typing and scrolling keep full precision. Happy to change that if you would
rather the list preserve them.