Rather than stay in a black hole whilst working on the Calendar Mk2 system, I thought, that instead, I’ll provide some regular updates.
These updates might not necessarily prove useful in of themselves, but at least they’ll let you folk know that I’m still working on things.
In the last post I alluded to the fact that I had refactored the code in the calendar backend without having updated the UI to use that code (Doh!). This resulted in various UI elements simply not working, or in extreme cases crashing!
A bit of a backward step considering we did have a mostly working system!
I’m now at a point where the UI is starting to work again.
Although a hard slog, I think the detour is worth it. The result is that the new code runs faster and because it is better encapsulated, the higher level code in the UI is also a lot simpler!
The hard bit is working out what needs to stay, what needs to go and what needs to be modified. This is quite a difficult task when one considers the complexity of the modelling (it’s complex because it can model any calendar you can imagine!)
Here are some screenshots that show the UI is now back and working… mostly….
Firstly we can now view mark 2 calendars again:

The above screenshot shows a Gregorian Calendar created with Sojour’s built in tools.
At this point, the structure of a year has been defined, but the Days of the Week rolling entities have not been switched on. The result is a calendar month with the correct number of days but no real context.
Next up, I switch on the Days of the Week rolling entities:

Straight away we can see a number of things have kicked in.
Firstly, days of the week now appear in the calendar and you can see that the relevant time units in the tree-view have been properly overridden by the rolling entities.
The other notable feature is the way the month view has automatically added space elements to allow all of the same days of the week to align in the correct column (the additional blank row at the bottom is an existing bug that will be fixed).
The fact that this is working at all, is somewhat miraculous, given how different the new backend code is.
Next up I tried turning off the upper header bar to see what would happen:
Right away, the system removes that header bar.
It has also realised that with no column headers, the calendar cells no longer have context – i.e. the day of the week. The system remedies this by automatically adding the day of the week to each calendar cell.
Speaking of calendar cells, these are not the finished product. The cells are currently rudimentary and are designed so that I can check the calendar calculations are working correctly. They will look a lot better and incorporate a lot of new functionality once completed.
Everything seems in order, although the ‘spare-row’ bug is still there.
Finally I turn off Days of the Week to make sure the tree-view reverts back to its original settings:

And it does! All good!
There is still a huge amount of work to do as I keep identifying additional use-cases that need to be covered off by the code. The good news is that the newer code is much better segregated, which makes adding new functionality like this a cinch.
The effort ploughed into this feature, so far:

That’s a lot of commits and development time!
Whilst this feature takes me away from Sojour’s more regular updates, I’m a firm believer that it is essential for Sojour’s longevity.
Sojour needs a calendar system that can model rolling calendars, which right now it cannot do. The current version cheats with regard to this feature by having the Gregorian calendar use the Windows Calendar! In contrast the new system does not do this and recreates all calendars from first principals.
That’s it for this mini update!
Have Fun!
RobP



