CalendarChange.h header
#include <ew/app/timeline/CalendarChange.h>
Namespace ew::app::timeline
CalendarReinterpretation struct
struct ew::app::timeline::CalendarReinterpretation
What editing a project's calendar would do to the dates already in it.
Every instant in a project is minutes since the epoch, and only the calendar says what a given minute MEANS. Calendar::toDate walks the month lengths, so changing them re-reads every stored instant: on a 360-day year (eight 45-day moons) the instant 648,000 is 1 Seedmoon of year 2, and adding a ninth moon makes the same instant 45 Thawmoon. Nothing in the project file changes and every date in the app does.
This is the shape of a preview, not a veto, and deliberately the same shape as ew::app::timeline::RuleImpact: say what would happen while the writer can still decide, because discovering it afterwards means discovering it across a whole timeline.
Members
int ew::app::timeline::CalendarReinterpretation::datedObjects = 0
How many stored instants would be read differently – timeline events, markers, era bands, recorded births and deaths, and dated scenes. Zero when nothing would move.
int ew::app::timeline::CalendarReinterpretation::oldDaysPerYear = 0
Days in a year before the edit; the headline number a writer recognises.
int ew::app::timeline::CalendarReinterpretation::newDaysPerYear = 0
Days in a year after it.
bool ew::app::timeline::CalendarReinterpretation::isHarmless() const
Whether the edit leaves every existing date meaning exactly what it meant.
Functions
CalendarReinterpretation ew::app::timeline::calendarReinterpretation(const ew::core::project::Project &project, const ew::core::calendar::Calendar &proposed)
What proposed would do to the dates already in project.
Reports nothing to worry about unless the sequence of MONTH LENGTHS changes – that alone is what the date arithmetic reads. Renaming a month, adding a weekday, changing the era or editing the named-era table leaves every instant meaning exactly what it meant, so those edits must not raise an alarm; a warning that cries wolf on a rename is a warning nobody reads on the day it matters.
Note that the year length can stay the same while dates still move: swapping two months' lengths (45/45 to 40/50) keeps 360 days and shifts everything after the first month. So the comparison is the whole sequence, not the total.