eui icon indicating copy to clipboard operation
eui copied to clipboard

EuiDatePicker input direct edit of date guesses timezone

Open marsh73 opened this issue 10 months ago • 3 comments

Describe the bug When using DatePicker with UTC date, If I select a time change from the dropdown it behaves as expected, but when I edit the date directly, it automatically adjusts the date to UTC in the dropdown, then in the actual date, once I click away. This feels like a bug. If it were deliberate i would expect that the same adjustment would be made when selecting a time from the dropdown.

it seems to assume when selecting from the dropdown that I know what I'm doing, but when manually entering the time, it has to make an adjustment for me. I went to your storybook examples for the utcOffset to see if it was my code or the component itself.

if you go here https://eui.elastic.co/#/forms/date-picker#utc-offsets select a time from the dropdown you'll see the time behaves as expected manually update the time by 1 minute you will see that when you click away it adjusts the hours to account for the offset. this is a confusing behavior

Impact and severity It's a confusing UX that can make it hard to create an exact search

Environment and versions bypassing this as you can recreate in your current storybook in your docs

To Reproduce Steps to reproduce the behavior:

  1. go here https://eui.elastic.co/#/forms/date-picker#utc-offsets
  2. select a time from the dropdown => you'll see the time behaves as expected
  3. manually update the time by 1 minute => you will see that when you click away it adjusts the hours to account for the offset.

this is a confusing behavior

Expected behavior editing the time input manually would behave as selecting a time input from the list... what i see, is what persists

Minimum reproducible sandbox It is extremely helpful for us if you are able to reproduce your issue in a minimum reproducible sandbox (visit our docs site and click the CodeSandbox logo in the top-right corner).

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

marsh73 avatar Apr 10 '24 22:04 marsh73

👋 Thank you for your suggestion or request! While the EUI team agrees that it's valid, it's unlikely that we will prioritize this issue on our roadmap. We'll leave the issue open if you or anyone else in the community wants to implement it by contributing to EUI. If not, this issue will auto close in one year.

github-actions[bot] avatar Apr 16 '24 16:04 github-actions[bot]

Hey @marsh73, thank you for the bug report. Since we're not really using these UTC offsets in Elastic products, we decided that we're not going to prioritize a fix at this time. However, we are always super grateful for community PRs.

JasonStoltz avatar Apr 16 '24 16:04 JasonStoltz

Thank you... if i can find a solution I'll submit a PR

marsh73 avatar Apr 26 '24 16:04 marsh73