turnilo icon indicating copy to clipboard operation
turnilo copied to clipboard

help wanted: may turnilo support 2020-10-10 VS 2020-10-11(-P1D, Negative Value of P1d)?

Open ly525 opened this issue 5 years ago • 3 comments

Hi, thanks for your great work.

I want to ask a question about Turnilo's date picker

I'm working on the date range picker, and it's coming to an end, but something's gotten me stuck. could you give me your advice?

image

Turnilo now supports 2020-10-11 VS 2020-10-10 (P1D) because timeshift follows ISO_8601

But in real business, we want to support 2020-10-10 VS 2020-10-11 (-P1D, Negative Value of P1d), or two time reversals.

ly525 avatar Dec 23 '19 09:12 ly525

After plywood and chronoshift code inspection I could imagine that would be possible. But I don't understand why?

Additionally, Turnilo understands time shift as "current" and "previous" periods. With negative shift that doesn't make sense and would require a lot of changes and risk of code that don't represent intent.

adrianmroz avatar Jan 02 '20 09:01 adrianmroz

@adrianmroz In practical, we have this requirement that we want to choose any day compare to any day, for example 2020-01-01 compare to 2020-01-03

the following image is an example for my requirement: image

image

ly525 avatar Jan 02 '20 11:01 ly525

@ly525 - thanks for the design discussion before coding :)

From the business perspective, comparison to any date range in the past seems reasonable as long as a few invariants are met:

  1. Current and the past date ranges do not overlap (see #460, #449)
  2. Current date range and the past date range are defined for the durations of the same length. Right now it is forced by UI, user is able to specify only the timeshift. The date range in the past is calculated automatically.
  3. Date range in the past is always in the past :)

From the UI perspective right now we have the following combinations available:

  1. Relative current date range + relative timeshift
  2. Fixed current date range + relative timeshift

I would imagine two additional combinations (please remember about invariants defined before):

  1. Relative current date range + fixed date range in the past for time shift. As long as relative current date range could move only forward all links from the past should be valid. But the date picker tab title "relative" will be misleading somehow. I'm also not fully convinced that this mode is useful at all.
  2. Fixed current date range + fixed date range in the past for timeshift. No objections here.

I would keep the existing timeshift selector using ISO periods (predefined or custom), it covers most business needs without complexity.

Do you have any UI proposal how to switch to the fixed range mode for timeshift? Please remember that the modes must be mutually exclusive, e.g: you could select either "P1D" or "2019-10-12 to 2019-10-15" but not both.

In addition it won't be a timeshift anymore. Timeshift takes single argument, for fixed date range it would be something different. How to call it?

mkuthan avatar Jan 02 '20 14:01 mkuthan