-
Notifications
You must be signed in to change notification settings - Fork 863
[EuiSuperDatePicker] More forgiving absolute input #9199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
💭 I'd suggest to run all changes in the feature branch against Kibana CI before merging to main. That way we'll know early if there are any unexpected issues. |
mgadewoll
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 The changes work as expected. That's a pretty neat user improvement 🎉
that sounds like a good idea, will do 👍 |
9b13608 to
e0802ae
Compare
36c3715 to
dd67df6
Compare
This reverts commit cf0a055. Wrongly included here because of a rebase
b133434 to
f469a97
Compare
💔 Build Failed
Failed CI StepsHistory
cc @acstll |
💔 Build Failed
Failed CI StepsHistory
cc @acstll |
Summary
Important
This PR merges into a feature branch
This makes the manual input of date and times more forgiving, in the Absolute tab. Meaning that is not needed for users to enter the entire date (sometimes in the in the exact format) for it to be parsed correctly.
Resolves https://github.com/elastic/eui-private/issues/439 🔒
Why are we making this change?
As part of a series of improvements to
EuiSuperDatePickerthat should have a positive immediate impact for users.Impact to users
🟡 Low to no impact. No changes required. I think it's unlikely but some tests may fail.
Changes
Technically this is changing a single prop passed to the underlying library doing the date/time parsing, Moment.js. Namely the prop for enabling Strict Mode parsing.
Until now strict mode was enabled for all formats: the one passed in the
dateFormatprop, and the other 3 supported (ISO 8601, RFC 2822 and Unix timestamp in seconds)). With this change, it will be disabled for the passeddateFormatonly if the entered value is not any of the other 3 formats.Parsing for ISO 8601, RFC 2822 and Unix remains unchanged. It behaves like the following:
ISO 8601 (unchanged)
Example:
2025-11-10T11:07:02ZForgiving. Entering a partial value works e.g.
2025-11.RFC 2822 (unchanged)
Example:
Tue, 10 Nov 2025 11:07:00 +0000Partially forgiving, only the optional day of week e.g.
Tuecan be left out.Unix timestamp, in seconds (unchanged)
Example:
1762772820Not forgiving (for obvious reasons).
Examples of changes in parsing
When entering a value and pressing Enter.
Nov 10, 2025Nov 10 2025Nov 10NovNov 10 2025 12:342024✝︎ parsed as ISO 8601
QA
🔗 Storybook for manual testing
General checklist
Checked in both light and dark modesChecked in both MacOS and Windows high contrast modes(emulate forced colors if you do not have access to a Windows machine.)Checked in mobileChecked for accessibility including keyboard-only and screenreader modesAdded documentationProps have proper autodocs (using@defaultif default values are missing) and playground togglesChecked Code Sandbox works for any docs examplesUpdated visual regression testsIf applicable, added the breaking change issue label (and filled out the breaking change checklist)If the changes unblock an issue in a different repo, smoke tested carefully (see Testing EUI features in Kibana ahead of time)If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)