Hi guys,
What’s the simplest way to return all weekends between two calendar:date()?
I’m looking for something like this:
August 2022
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
> weekend:list({2022,8,1}, {2022,8,4}).
[]
> weekend:list({2022,8,4}, {2022,8,11}).
[ {{2022,8,6}, {2022,8,7}} ]
> weekend:list({2022,8,4}, {2022,8,13}).
[ {{2022,8,6}, {2022,8,7}} ]
> weekend:list({2022,8,4}, {2022,8,14}).
[ {{2022,8,6}, {2022,8,7}}, {{2022,8,13}, {2022,8,14}} ]
> weekend:list({2022,8,01}, {2022,8,31}).
[ {{2022,8,6}, {2022,8,7}}, {{2022,8,13}, {2022,8,14}}, {{2022,8,20}, {2022,8,21}}, {{2022,8,27}, {2022,8,28}} ]
> weekend:list({2023,8,1}, {2022,8,1}).
[]
Many thanks.