How Check if a date is in next 14 days?

How Check if a date is in next 14 days? any recipe please? The functions are not sufficient enough to use after trying different ways. 

  Discussion posts and replies are publicly visible

Parents
  • Hi Anusha,

    Its not very clear why you cannot use foreach, but, if you want to fetch all the dates which are < = 14 days from the list of dates, can you try below code:

    with(
    /* If you want index of dates qualified. index can be useful to retrieve related data from complex or custom data type.
    Use wherecontains function.
    */
    local!qulifiedDateIndex: a!forEach(
    items: ri!dateList,
    expression: if(
    fv!item <= (today() + 14),
    fv!index,
    null
    )
    ),
    /* If you want dates qualified*/
    local!qulifiedDates: a!forEach(
    items: ri!dateList,
    expression: if(
    fv!item <= (today() + 14),
    fv!item,
    null
    )
    ),
    reject(fn!isnull, local!qulifiedDates)
    )

    Thanks.
Reply
  • Hi Anusha,

    Its not very clear why you cannot use foreach, but, if you want to fetch all the dates which are < = 14 days from the list of dates, can you try below code:

    with(
    /* If you want index of dates qualified. index can be useful to retrieve related data from complex or custom data type.
    Use wherecontains function.
    */
    local!qulifiedDateIndex: a!forEach(
    items: ri!dateList,
    expression: if(
    fv!item <= (today() + 14),
    fv!index,
    null
    )
    ),
    /* If you want dates qualified*/
    local!qulifiedDates: a!forEach(
    items: ri!dateList,
    expression: if(
    fv!item <= (today() + 14),
    fv!item,
    null
    )
    ),
    reject(fn!isnull, local!qulifiedDates)
    )

    Thanks.
Children
No Data