function for getting dashboard timeframe

I tried to achieve the effect for the timeframe you need, but was unable to. In my opinion it is not possible to build such a time filter.

I recommend you to open Product Idea if you think it makes sense for more cases.