Skip to main content
bramhan0001
May 17, 2021
Question

How to show date range(Mon to Fri) in dropdown field ?

  • May 17, 2021
  • 3 replies
  • 0 views

Hi, I would like to show date range (Mon to Fri by default and I have created rule for this) so I have a requirement to show date range in dropdown field. Thus user will select particular date range and data will modify according to date from Monday to  Friday. Is there any best approach to do that ? Will appreciate your help.

Below are the images for ref. in first image user has selected date range 5/3/21 - 5/9/21 (Mon To Fri) and it's filtering data by date in 2nd image

3 replies

bramhan0001
May 17, 2021

this is the rule which I'm using to get date range

load(
local!currentDay:weekday(ri!testDate),
local!mondayDate:2-local!currentDay,
local!fridayDate:6-local!currentDay,
{
ri!testDate+local!mondayDate & " - " & ri!testDate+local!fridayDate,

}
)

stefanhelzle0001
Brainy
May 17, 2021

This creates a list of 10 ranges for a given start date

a!localVariables(
  local!currentDay: weekday(ri!startDate),
  local!mondayDate: ri!testDate + (2-local!currentDay),
  a!forEach(
    items: enumerate(10) * 7,
    expression: concat(
      local!mondayDate + fv!item,
      " - ",
      local!mondayDate + fv!item + 5
    )
  )
)

bramhan0001
May 17, 2021

Ok Stefan. I'll try this one. Thank you