Skip to content

[BUG] Time Range not working properly with relative dates #61

@zhongnansu

Description

@zhongnansu

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Plugins
Please list all plugins currently enabled.

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

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.


Steps to reproduce:

  1. Create a report definition
  2. On time range field, use relative ranges eg. "from 7 days ago (round)" and "to now".
  3. Save the report definition
  4. Reopen it a minute later

Note that since internally the KibanaReports plugin converts the range field from elasticsearch DateMath to ISO duration, it is not able to do some things, for example the "round" option won't work properly.

Since I'm working on a lot of issues that I found on this plugin, reading the code I noticed that it don't use DateMath to store the time range of the report. This makes no sense because ISO duration will not be able to represent the same range selected on the default EuiSuperDatePicker.

I really see no reason for not using DateMath to store the range:

{
  from: "now/d-7d",
  to: "now"
}

This issue was originally submitted by @iget-master
opendistro-for-elasticsearch/kibana-reports#353

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdiscussneed discussion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions