Skip to content

[Explore] New time picker breaks old charts with "x days" in time picker start date #12508

@ktmud

Description

@ktmud

Expected results

In 0.38 and earlier, if you set "30 days" or "5 months" in start date (without "ago", "before", or "last"), it will be automatically converted to the equivalent of "30 days ago". The new time picker will treat it as "30 days after today", causing an Unexpected time range: From date cannot be larger than to date error for some existing charts.

Here are examples of time ranges that will break in the new time picker but are valid for the old one:

  1. "30 days: " -> "30 days ago : now"
  2. "7 days: 7 days" -> "7 days ago : 7 days after today"

Actual results

Existing charts with "x periods" set in start date should behave the same.

Since the original behavior is a little bit ambiguous, we may actually want to force users to use "30 days ago" or "- 30 days" for this use case. So I think it's OK to keep current logic, but to minimize disruption, we should do a db migration to automatically fix such charts and add a breaking change warning in the v1.0 changelog (albeit numbers users who used this syntax is low).

Environment

Latest master

Metadata

Metadata

Assignees

Labels

enhancement:committedEnhancement planned / committed by a contributorexplore:timeRelated to the time filters in Explore

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions