It is possible to calculate more info on the current search?

I was navigating and reading on the Dynamically inserting dates and times

And I found this awesome date calculator. But, Is it possible that when calculating the days between the two dates, I can take out, apart from the total number of days, the holidays and Sundays?

Select the first date: {formdate: YYYY-MM-DD; name=date1}
Select the second date: {formdate: YYYY-MM-DD; name=date2; default={time: YYYY-MM-DD; shift=+1D}}
{difference=datetimediff(date1, date2, "D"); trim=left}

Using datetimediff, I can determine that these two dates are {=difference} days apart.

{if: difference<0}The second date selected is prior to the first date selected{elseif: difference>0}The second date selected is after the first date selected{else}Both selected days are the same{endif}

Holidays are complicated since they are different for different countries and sometimes can change.

You can use the following snippet for calculating the amount of days excluding weekends (Sat and Sun):

{formdate: YYYY-MM-DD; name=begin}
{formdate: YYYY-MM-DD; name=end}

{repeat: for x in seq(0, 500)}{if: {time: YYYY-MM-DD; shift={=x}D(skip=SAT, SUN); at={=begin}; pattern=YYYY-MM-DD}==end}{=x} days, excluding Saturday and Sunday{endif}{endrepeat}

1 Like

OMG!!!! I <3 u!!!

If I need the data for those days only for the US, will it be possible?