Skip to content

Conversation

@acstll
Copy link
Contributor

@acstll acstll commented Nov 10, 2025

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 EuiSuperDatePicker that 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 dateFormat prop, and the other 3 supported (ISO 8601, RFC 2822 and Unix timestamp in seconds)). With this change, it will be disabled for the passed dateFormat only 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:02Z

Forgiving. Entering a partial value works e.g. 2025-11.

RFC 2822 (unchanged)

Example: Tue, 10 Nov 2025 11:07:00 +0000

Partially forgiving, only the optional day of week e.g. Tue can be left out.

Unix timestamp, in seconds (unchanged)

Example: 1762772820

Not forgiving (for obvious reasons).

Examples of changes in parsing

When entering a value and pressing Enter.

Input Before After
Nov 10, 2025 ⚠️ Invalid ✅ Nov 10, 2025 @ 00:00:00.000
Nov 10 2025 ⚠️ Invalid ✅ Nov 10, 2025 @ 00:00:00.000
Nov 10 ⚠️ Invalid ✅ Nov 10, 2025 @ 00:00:00.000
Nov ⚠️ Invalid ✅ Nov 1, 2025 @ 00:00:00.000
Nov 10 2025 12:34 ⚠️ Invalid ✅ Nov 10, 2025 @ 12:34:00.000
2024 Jan 1, 2024 @ 00:00:00.000✝︎ Jan 1, 2024 @ 00:00:00.000

✝︎ parsed as ISO 8601

QA

🔗 Storybook for manual testing

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in both MacOS and Windows high contrast modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately
    • If 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)
  • Designer checklist
    • 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)

@acstll acstll self-assigned this Nov 10, 2025
@acstll acstll marked this pull request as ready for review November 10, 2025 15:06
@acstll acstll requested a review from a team as a code owner November 10, 2025 15:06
@mgadewoll mgadewoll self-requested a review November 12, 2025 10:17
@mgadewoll
Copy link
Contributor

mgadewoll commented Nov 12, 2025

🟡 Low to no impact. No changes required. I think it's unlikely but some tests may fail.

💭 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.

Copy link
Contributor

@mgadewoll mgadewoll left a 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 🎉

@acstll
Copy link
Contributor Author

acstll commented Nov 12, 2025

🟡 Low to no impact. No changes required. I think it's unlikely but some tests may fail.

💭 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.

that sounds like a good idea, will do 👍

@acstll acstll force-pushed the feat/super-date-picker-track-1-ms-1 branch from 9b13608 to e0802ae Compare November 13, 2025 09:18
@acstll acstll deleted the branch elastic:main November 14, 2025 16:05
@acstll acstll closed this Nov 14, 2025
@acstll acstll reopened this Nov 18, 2025
@acstll acstll changed the base branch from feat/super-date-picker-track-1-ms-1 to main November 18, 2025 11:45
@acstll acstll force-pushed the super-date-picker-forgiving-input branch from 36c3715 to dd67df6 Compare November 18, 2025 12:48
@acstll acstll force-pushed the super-date-picker-forgiving-input branch from b133434 to f469a97 Compare November 18, 2025 13:24
@elasticmachine
Copy link
Collaborator

💔 Build Failed

Failed CI Steps

History

cc @acstll

@elasticmachine
Copy link
Collaborator

💔 Build Failed

Failed CI Steps

History

cc @acstll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants