I tried the following:
An Event has a calculated field ToDays(Date - Today()) which is the difference from Today as number field.
However, in a board view, the formula field cannot be set as columns.
Then I created a database ‘WeekDay’ with the 7 entities named Monday to Sunday, each with a calculated field ‘WeekDayDate’ that displays a Date relative to Today.
In the Event database I created a relation field to the WeekDay database, and an automation that triggers daily at 00:00 to set the Event its WeekDay relation to to the WeekDay which has a WeekDayDate that corresponds with the Event Date.
Can you see a more efficient way to accomplish this?
Populate it with 365 entities, each representing one day of the year.
Initial Population Script:
Develop and run a one-time script to fill the ‘YearDays’ database with date entities for an entire year.
Event Database Update:
In the ‘Event’ database, add a relationship field (e.g., ‘YearDate’) linked to ‘YearDays’.
Implement a script or automation that updates the ‘YearDate’ field whenever an ‘Event’ date is modified, aligning it with the corresponding date in ‘YearDays’.
Board View with Range Filters:
Utilize the ‘YearDate’ field in the ‘Event’ database as columns in a board view.
Apply range filters in the board view to display events within specific time frames, like a week or a few days.
Make sure to save it as the Date data type (not Date time).
Now you can create an auto-relation to your Event db, with the matching rule using the Date field in the Event db and the Date field in the Day this Week database:
Your solution is very well thought out, and very efficient, thank you!
In my case, the Event Date field is of type Date Time.
I can still use your solution, but need to add an extra new Event Date field type Date, that gets its value through an automation from the Event DateTime field, using the formula: