How to Coda a Divorce Planning II
Holidays and changing periods
--
In my previous and first blog on Divorce Planning I showed the outcome of some basic agreement on when will the children be with each parent. I updated this part by adding a data picker. I looks like below. The code changed as well. In a previous blog I wrote about date pickers and this logic I applied again.
In this blog we focus on:
- Annual holidays like Christmas
- School holidays
- Birthdays
Annual & School Holidays
In my case we have the school holidays that cover multiple weeks and we have the annual holidays like Eastern and Christmas. Some divorced couples continue their schedule all through the year, we assumed it was practical to provide for some variaton.
I am using a table that calculates automatically state and religious (moon based) holidays like Eastern, Pentecost, White Monday, etc. The logic behind this table is complicated and although automatic updates are great, you can easily take a calendar and fill out manually the dates per year in your table. How the dates arrive does not matter for the set up that calcules the interaction between holidays and the general planning.
In the main holiday table I have both the annual holidays as well as the school holidays. This table is nourished by two other tables, one containing the latest annual holidays and one that is only about school holidays. No matter how you set this up, as long as the dates are right, you are covered and you can move forward.
Once we have all these (school) holidays living in one table, we have to decide for which ones we want to have a different set up compared to the daily routine. We therefore created a table that has these lookup columns:
- holidays
- holiday logic parents
- weekdays
- standard logic for parents
The holidays relate to dates and thus to the dates you entered in your main sub tables that come together in the main table. Below how it goes. We select the holidays we want specific arrangements for.
The next step is pressing the button (I’ll come back to this in a next blog) and your table to fill out manually is ready.
So far I assumed that all kids are with the same parent at the same time, but this is not necessarily the case for every divorced couple. I know about families that took a different path, sometimes from the beginning sometimes it happend to be a better fit with one of the parents. We will deal wit this issue in a blog III, below how a planning looks likes for a part of the holiday.
I used grouping and the standard logic makes it easier to align with the normal routine. The weekends are grey (conditional formatting) and based on this rule, since live in Europe so I follow the IsoWeekDay Logic.
thisRow.dates.IsoWeekday().Contains(6,7)
Our Main Task — Integration
No matter how important it is to set up the holiday table, the main challenge is to integrate the holiday planning into the main planning. The table DB Planning is filled out with rows based on a date picker and based on DB Distribution. This we showed in the first blog. Our next step is to integrate these holiday arrangements into DB Planning and we do so by adding the function ModifyRows()
. First I thought about AddOrModifyRows()
but this will complicate the matters when your main list is not yet about the periods that covers the holidays. In that case you see the holidays added a the bottom of your table and this does not look good.
ModifyRows()
We take the table DB planning, we filter on the dates and for these dates we change the value, but only for dates that are not blank. Below the complete function. First I add rows and I close all functions. Note, you can also go with AddOrModifyRows()
and use the TheDates as match value, but simply adding rows is in many cases easy, if you don’t like it, you clear the table and start again. Second I open a new calculation to Modify certain rows: the ones that are related to holiday arrangements.
The outcome is what you see below and I am rather happy with it. It goes fast and the overview is a great support to set up a planning.
And this alignes with the holiday planning we made up earlier:
The Birthdays
The celebration of a birthday is for most children the most important day of the year with gifts from parents, family, friends and a birthday party. We base our calculation on the table below:
The visual aspects supports the discussion on various practical matters in my experience (like where do we plan the birthday party).
[DB People].Filter(NextBD.Contains(thisRow.Date))
Here we are. We have a table that not only takes into account the standard planning, but also reflects holiday plannings and shows birthdays. In our next blog we explore more complex variations. See you there!
I hope you enjoyed this article. If you have questions feel free to reach out. Though this article is for free, my work (including advice) won’t be, but there is always room for a chat to see what can be done. Besides you find my (for free) contributions to the Coda Community and on Twitter
My name is Christiaan and I support SMB with calculations (budgets and planning) and I prefer using Coda to get the job done.
Coda comes with a set of building blocksーlike pages for infinite depth, tables that talk to each other, and buttons that take action inside or outside your docーso anyone can make a doc as powerful as an app (source).
Not to forget: the Coda Community provides great insights for free once you add a sample doc.
If you enjoyed this read and would like to get more Coda related content, please consider a Medium membership. It is it only $5 a month, and you’ll have access to every article ever published on Medium. If you sign up using my referral link, I’ll earn a small commission.