Skip to main content
March 5, 2021
Solved

How to get all dates between a date range

  • March 5, 2021
  • 5 replies
  • 0 views

I have two dates ex. 03/05/2021 & 03/10/2021, I am trying to get all dates within this range. (i.e  03/05/2021, 03/06/2021, 03/07/2021, 03/08/2021, 03/09/2021, 03/10/2021).

Please help me with it.

    Best answer by carloss662

    Define two rule inputs (ri!startDate, ri!endDate) for the following rule:

    = a!foreach(
      items: enum(1+tointeger(ri!endDate-ri!startDate)),
      expression: ri!startDate+fv!item
    )
    

    You'll want to add validations before using this in your application.

    5 replies

    March 5, 2021

    Define two rule inputs (ri!startDate, ri!endDate) for the following rule:

    = a!foreach(
      items: enum(1+tointeger(ri!endDate-ri!startDate)),
      expression: ri!startDate+fv!item
    )
    

    You'll want to add validations before using this in your application.

    March 5, 2021

    Thanks [emoticon:c4563cd7d5574777a71c318021cbbcc8]