Beginning some serious work on dates
I've started work on the date conversion code for handling Julian vs Gregorian proleptic. It's astoundingly complicated, but for now I've decided to handle two core features: the increasing day offset caused by the Julian leap year miscalculation, and the fact that between 1155 and 1751 the year was generally viewed as starting on March 25. There are dozens of other potential gotchas, but this will at least give us a basic way of handling conversion that will be approximately right nearly all the time.
The core ideas are:
- Where @calendar="mol:julian", the encoder will either do a calculation to create gregorian date values (which will only really happen if there's solid evidence to enable this), or they'll encode the date string using @when-custom and friends from att.datable.custom.
- If this is a transcription of a source, the original text will go into the date element, and that will be what's rendered. If there's no source text, then the date element may be empty.
- In the former case, the original text will be rendered faithfully, and a mouseover will be created explaining the date in gregorian.
- In the latter case, a rendering will be created according to our styleguide (based on MLA and on practice from elsewhere that CB is collecting), and again, a mouseover will give expanded detail.
I've spun off all the XSLT relating to dates into a separate module, and created a testing module that I'm building as I go along, so that we can verify everything is working without too much extra work whenever we make a change.