Suppose you want to view all the records for the current week, based on a {Due Date} field. The {Due Date} could be any day of the week: Monday through Friday, and you want to see all the records within the current week, whether or not they are before or after the current day. For example, on Wednesday, you want to see records that were due back on Monday as well as records that won’t come due until Friday.
Airtable filters work well for showing dates before or after a given date, or within a specific interval of dates before or after the current date. However, Airtable filters don’t do well when the number of dates before/after the current date change.
One answer is to create a formula field that converts both the {Due Date} and TODAY() to the starting day of the week and compares them. You can then fitter on the result. In the screen shot below, there are two comparison fields, one that just checks if the record is due this week, another that gives a number indicating if the record is in the current week, next week, previous week, etc.
Here is a formula that converts a date to the preceding Sunday.
DATEADD(
{Due Date},
WEEKDAY({Due Date}) * -1,
"days"
)
The other formulas are easily derived from this one.
- To find the preceding Sunday for the current week, use TODAY() instead of {Due Date}
- To compare the two calculated dates, use DATETIME_DIFF() or IS_SAME().