i have 1 date picker, when user select date - it should show count of working days excluding weekends & holidays in that selected month.
holidays stored in Collection as
ClearCollect(Holidays,
{Date1:7/24/2023,Type:Pioneer Day},
etc......
but it is not excluding holidays list from collection
ClearCollect(
Col_Holidaylist,
Table(
{Date1: Text(DateValue("16-Jan-2023"), "d-mmm-yyyy"), Type: "Optional Holiday"},
{Date1: Text(DateValue("26-Jan-2023"), "d-mmm-yyyy"), Type: "Company Holiday"},
{Date1: Text(DateValue("8-Mar-2023"), "d-mmm-yyyy"), Type: "Optional Holiday"},
{Date1: Text(DateValue("22-Mar-2023"), "d-mmm-yyyy"), Type: "Optional Holiday"},
{Date1: Text(DateValue("4-Apr-2023"), "d-mmm-yyyy"), Type: "Optional Holiday"}
{
)
);
Hi @venky232 ,
The Collection you offered.
Text of TextLabel:
With(
{
varDateRange: ForAll(
Sequence(31,1),
Text(Month(DatePicker1.SelectedDate) & "/" & Value & "/" & Year(DatePicker1.SelectedDate),"DD/MM/YYYY")
)
},
// show only dates Monday to Friday and exclude holidays
CountIf(
varDateRange,
And(
Weekday(Value,StartOfWeek.Sunday) in [2, 3, 4, 5, 6],
Not(Value in Holidays.Date1)
)
)
)
Hope this will help you,
Best Regards,
Tina
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional