Forum Academy Marketplace Showcase Pricing Features

Dropdown with preset date periods

I would like to create a dropdown that contains date periods already defined in a fixed way.
So it should contain the following items for example:

  • this month
  • last month
  • last 3 months
  • last 6 months
  • last year

When the user selects one of the options, I should be able to convert this into a date range (date from and date till) and use it to filter my dataset.
Anyone has a thought on how to achieve this?

Hi there, @arend… one way you could go is to use an option set to define the date periods, and show the option set’s options in a dropdown. Then, add conditions to a repeating group to change its data source when an option is selected, and use constraints to define the date ranges. For example, here is what the constraints for Last Month would look like.

Hope this helps.

Best…
Mike

Thanks, that looks like an interesting solution. I will give it a try. For now I used the fantastic date range picker plugin as it also offers to select fixed datasets.
But your suggestion is more interesting for me as I can restrict the date frames more.
Thanks!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.