Fixing Rangeselector on a specific time


I defined a rangeselector with 5 buttons:
“1 Month”, “6 Months”, “1 Year”, “YTD”, “all”

In that way I can display data for one month, 6 month, etc…

As you can see, I have also implemented a line, which represents the current date.
However, if I click on a button (for example 6 months), it randomly shows me a section of 6 months period (here starting from February 2023, eventho currently it is march 2022):

However, I would like the rangeselector to orient and fix the selections on the current date.
Is there a way to do so?


import go

to inspect the possible settings for buttons.