Is there a way to update the "range-picker"?

Hi there!
I've been trying so hard to update this picker component from the date-range:

Basically the default behavior is to show current month + next month, what I need to do is to move the shown months to previous month + current month (so, instead of May - Jun It would be Apr - May).
I read the docs, specially this several times and I've tried all the set methods listed there but those methods updates the actual value so, I couldn't find a way to update that component.

Is there a way to update the "range-picker"?

To show the previous month and the current month (e.g. April - May) by default in the date range picker, you should use the prop that controls the initial displayed months, not the selected value.

If you're using:

  1. Ant Design (antd): use defaultPickerValue
    <RangePicker
    defaultPickerValue={[dayjs('2025-04-01'), dayjs('2025-05-01')]}
    />

  2. React-DateRange (by Hacker0x01): use shownDate
    <DateRangePicker
    shownDate={new Date(2025, 3)} // April (month is 0-based)
    />

This is my first time working with Retool so maybe this is a silly question, but, where can I see that?
I haven't seen anything like that :confused: . I'm using the default daterange component from retool

I don't know that there is a way to change that display without setting a value of "last month" in the start date.
That could look misleading to your user, however, if they mistakenly believe that they've selected a start date.
You could use {{ moment().subtract(1, 'month') }} or something similar - that would trick it into showing last month and this month in the drop down but the start date would appear to already be set:
image

Effectively!
I've tried that approach but it is not a good user experience just to show the previous month, bc the user will need to clean and re select the desired dates.
I'm still trying different approaches but I'm about to give up it looks like that there is not a way to do this.

@Gaston_Medina,
I believe you are correct. There is no way to do this without having to select a start date explicitly. I will submit a feature request for this.

1 Like