Skip to content
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

EuiSuperDatePicker UTC offset #3433

Closed
steve-offutt opened this issue May 6, 2020 · 3 comments · Fixed by #3436
Closed

EuiSuperDatePicker UTC offset #3433

steve-offutt opened this issue May 6, 2020 · 3 comments · Fixed by #3436

Comments

@steve-offutt
Copy link

My team and I are using this library to mainly do review of logs. We have had a lot of success using your other components contained in this library. It's been great! However, there is one issue that I need help with. This application that we are using uses the EuiSuperDatePicker to filter and search through logs. The user is expected to perform the search in UTC as we get logs from all different timezones and the underlying logs are all standardized to UTC. While using this component we observe that when we select a datetime, May 5, 2020 @ 00:00:00.000 the EuiSuperDatePicker is converting that datetime to UTC (May 5, 2020 @ 05:00:00.000 suppose I live in CDT). What that means for us in our use case is that we must convert that back to May 5, 2020 @ 00:00:00.000.

While looking through this code base I noticed that EuiDatePicker has a utcOffset prop

Is there a way that we can pass something similar to EuiSuperDatePicker so that we don't have to do these conversions?

-Thanks

@cchaos
Copy link
Contributor

cchaos commented May 6, 2020

The underlying component within EuiSuperDatePicker are our regular EuiDatePickers so it stands to reason that we should be able to pass down the utcOffset prop.

@anishagg17
Copy link
Contributor

Working on this one 🔧

@thompsongl
Copy link
Contributor

thompsongl commented May 7, 2020

After reviewing #3436, it doesn't appear that the utcOffset prop in EuiDatePicker does what it says/what we think.

In the docs, the actual UTC offset is done on selected value itself:

const selected =
this.state.startDate &&
this.state.startDate.clone().utcOffset(this.state.utcOffset);

And passing just the offset value via the utcOffset prop has no effect.

As such, simply passing through utcOffset to EuiSuperDatePicker also has no effect.

There are 0 usages in Kibana so it's hard to track correct usage and output.

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

Successfully merging a pull request may close this issue.

4 participants