So this isn't possible currently, but it's something that makes sense. Let's think through the syntax a bit here.
The best approach would probably be to add another attribute to the {time} command that lets you specify the base date. Maybe that attribute could be called at
.
So if you wanted to get the date at Jan 1, 2000, you would use something like:
{time: MM Do, YYYY; at=2000-01-01}
Shifts would apply relative to that date, so if you wanted to get the date 10 days after Jan 1, 2000 you would use:
{time: MM Do, YYYY; at=2000-01-01; shift=10D}
The one problematic point here is how to define the format for date/time passed to the at
? Text Blaze needs to know how to interpret the date (and time) you specify here. Of course this can change between different locales. E.g. American dates transpose the day/month compared to European dates.
So let's also add a pattern
attribute that tells Text Blaze how to interpret the at
date. For example the following tells Text Blaze that thee date is a long year followed by a two digit month and day:
{time: MM Do, YYYY; at=2000-01-01; pattern=YYYY-MM-DD}
Now that should work well, but needing to specify pattern
all the time is a pain and rather verbose. Let's make pattern
optional and when it is missing default to a "best effort" parsing of the data.
If pattern
is ommited Text Blaze will try to use ISO 8601 https://en.wikipedia.org/wiki/ISO_8601 falling back to locale specific date parsing if that fails. So something like this would work in an english locale:
{time: MM Do, YYYY; at=Jan 1, 2000}
What do you think about that?