How to Dynamically Count Number of Sundays in a Date Range

I’m sure there is a simple way to do this, I just can’t figure it out. For a calculation that I am using, I need to be able to count dynamically the number of Sundays there were within the 30, 60, and 90 days prior to the current date and time. I know that getting the number of “calendar days” is simply a matter of subtracting the current date from the date 30, 60, and 90 days ago. But how do I limit the count to just the number of Sundays in that time period? Any help would be greatly appreciated.

1 Like

Convert those list of dates into their numbered days ie. :extract day.

Then :filter the 0s and :count.

1 Like

Got it. I’ll give that a try. Thanks so much.

Thanks for the suggestion. But there aren’t a list of dates here though?:thinking:

I’m just assuming that OP has a list of dates :sweat_smile:

There are a few ways to get them though. The simplest would be to use a plugin that can generate a list of dates.

OK. Thanks. I was racking my brain trying to figure out how to get the list and I was too proud to ask the follow-up question. Gotta work on that. I’ll find a plugin. Thanks so much to both of you.

1 Like