Hi. I am not getting the desired result. Here is my code used in App OnStart:
ClearCollect(
HolidayList,
{Description:"New Year's Day",HolidayDate:Date(2021,1,1)},
{Description:"Human Rights Day",HolidayDate:Date(2021,3,22)},
{Description:"Good Friday",HolidayDate:Date(2021,4,2)},
{Description:"Family Day",HolidayDate:Date(2021,4,5)},
{Description:"Freedom Day",HolidayDate:Date(2021,4,27)},
{Description:"International Workers' Day",HolidayDate:Date(2021,5,1)},
{Description:"Youth Day (in South Africa)",HolidayDate:Date(2021,6,16)},
{Description:"National Women's Day",HolidayDate:Date(2021,8,9)},
{Description:"Heritage Day",HolidayDate:Date(2021,9,24)},
{Description:"Day of Reconciliation",HolidayDate:Date(2021,12,16)},
{Description:"Christmas Day",HolidayDate:Date(2021,12,25)},
{Description:"Boxing Day",HolidayDate:Date(2021,12,27)}
);
Set(StartDateTime,Date(2021,4,1)+Time(23,0,0));
Set(EndDateTime,Date(2021,4,6)+Time(01,0,0))
I did this as an example because the 2nd of April (Friday) was a public holiday, then the weekend, then Monday the 5th was a public holiday. So 11pm on the 1st to 1am on the 6th should only be 2 hours. Using your code to get the difference, I get 72 hours.
If I use this I should get 24 hours but I get 83:
Set(StartDateTime,Date(2021,4,1)+Time(12,0,0));
Set(EndDateTime,Date(2021,4,6)+Time(12,0,0))
Am I doing something wrong?