How to get dates and days of week

How to get  dates and days of week:

For example previous week was started on 19th October 2020 and ended on 25th October 2020,

So how do we get all days and dates between 19th and 25th,

Basically how do we gets to know the days and dates of the week.

Thanks in advance!

  Discussion posts and replies are publicly visible

Parents
  • Hi,

    Not exactly sure of the requirement but would something like this work. Local Start and End dates would become rule inputs of course. But this will return a list of dates that you could then query/manipulate in any way you wanted.

    a!localVariables(
      local!start: fn!date(2020, 10, 19),
      local!end: fn!date(2020, 10, 25),
      local!numberOfDays: tointeger((local!end - local!start) + 1),
      local!dateList: repeat(local!numberOfDays, local!start),
      a!forEach(
        items: local!dateList,
        expression: fv!item + (fv!index-1)
      )
    )

Reply
  • Hi,

    Not exactly sure of the requirement but would something like this work. Local Start and End dates would become rule inputs of course. But this will return a list of dates that you could then query/manipulate in any way you wanted.

    a!localVariables(
      local!start: fn!date(2020, 10, 19),
      local!end: fn!date(2020, 10, 25),
      local!numberOfDays: tointeger((local!end - local!start) + 1),
      local!dateList: repeat(local!numberOfDays, local!start),
      a!forEach(
        items: local!dateList,
        expression: fv!item + (fv!index-1)
      )
    )

Children