tremor icon indicating copy to clipboard operation
tremor copied to clipboard

Would be nice to have quarter as a relative date (or custom dates)

Open nmandal opened this issue 2 years ago • 2 comments

Currently it looks like relative date choices are (last 7 days, last 30 days, MTD, YTD)

What if there was also an option for last quarter or QTD? Or last year? Or All (to beginning of data)

nmandal avatar Oct 11 '22 17:10 nmandal

Thanks @nmandal for the comment, having a QTD option definitely makes sense. We are generally thinking about implementing a solution that allows users to add custom relative date options. Wdyt?

mitrotasios avatar Oct 11 '22 18:10 mitrotasios

That makes great sense to me. I think having the choice between a default set of relative date choices similar to what exists today and then having the choice to input a map similar to below for custom options would be great.

Are you thinking about something like this?

export const relativeFilterOptions = [
    {
        value: 'w',
        name: 'Last 7 days',
       selectedStartDay(sub(today, { days: 7 }));
       selectedEndDay(today);
    },
    ...
];

(from: https://github.com/tremorlabs/tremor/blob/873a609bb37fef8dcf3f62097593a4257bc9dad8/src/components/input-elements/Datepicker/utils.tsx#L15)

nmandal avatar Oct 11 '22 19:10 nmandal

closing as it is resolved in v2

mitrotasios avatar Apr 20 '23 15:04 mitrotasios