MT-SomeDays 2.1.0 »
After a minor issue with a shell rebuild script and my mind continuing to spin overnight, it turns out it's time for yet another update to MT-SomeDays.
This should be the last for a while, because I am flat out of ideas. One note about this new version. The daily conditional tags (<MTSDIfSunday>) have been shortened to the first three characters of the name (<MTSDIfSun>). I hope this doesn't cause you too much trouble.
In the spirit of keeping this as short as possible, here are the new data tags:
<$MTSDEvalDate$> - the "evaluation" date, after adjusting for selections
<$MTSDEvalDayOfWeek$> - the day of week (0-6) of the evaluation date
The new attributes:
<MTSomeDays date="first"> - selects first day with published entries
<MTSomeDays date="last"> - selects last day with published entries
<MTSomeDays select="since"> - selects from first date with published entries
<MTSomeDays select="until"> - selects through last date with published entries
And the new conditional tags:
<MTSDIfEval></MTSDIfEval> - if processing date == evaluated date (YYYYMMDD)
<MTSDIfEvalDOM></MTSDIfEvalDOM> - if processing day of month == evaluated dom (DD)
<MTSDIfEvalDOW></MTSDIfEvalDOW> - if processing day of week == evaluated dow (0-6)
<MTSDIfEvalDOY></MTSDIfEvalDOY> - if processing day of year == evaluated doy (MMDD)
<MTSDIfEvalEOM></MTSDIfEvalEOM> - if processing date == evaluated end of month (MMDD)
<MTSDIfEvalSOM></MTSDIfEvalSOM> - if processing date == evaluated start of month (MMDD)
<MTSDIfNotEval></MTSDIfNotEval> - if processing date <> evaluated date (YYYYMMDD)
<MTSDIfNotEvalDOM></MTSDIfNotEvalDOM> - if processing day of month <> evaluated dom (DD)
<MTSDIfNotEvalDOW></MTSDIfNotEvalDOW> - if processing day of week <> evaluated dow (0-6)
<MTSDIfNotEvalDOY></MTSDIfNotEvalDOY> - if processing day of year <> evaluated doy (MMDD)
<MTSDIfNotEvalEOM></MTSDIfNotEvalEOM> - if processing date <> evaluated end of month (MMDD)
<MTSDIfNotEvalSOM></MTSDIfNotEvalSOM> - if processing date <> evaluated start of month (MMDD)
<MTSDIfJan></MTSDIfJan> - processing date == month 1
<MTSDIfFeb></MTSDIfFeb> - processing date == month 2
<MTSDIfMar></MTSDIfMar> - processing date == month 3
<MTSDIfApr></MTSDIfApr> - processing date == month 4
<MTSDIfMay></MTSDIfMay> - processing date == month 5
<MTSDIfJun></MTSDIfJun> - processing date == month 6
<MTSDIfJul></MTSDIfJul> - processing date == month 7
<MTSDIfAug></MTSDIfAug> - processing date == month 8
<MTSDIfSep></MTSDIfSep> - processing date == month 9
<MTSDIfOct></MTSDIfOct> - processing date == month 10
<MTSDIfNov></MTSDIfNov> - processing date == month 11
<MTSDIfDec></MTSDIfAug> - processing date == month 12
<MTSDIfNotJan></MTSDIfNotJan> - processing date <> month 1
<MTSDIfNotFeb></MTSDIfNotFeb> - processing date <> month 2
<MTSDIfNotMar></MTSDIfNotMar> - processing date <> month 3
<MTSDIfNotApr></MTSDIfNotApr> - processing date <> month 4
<MTSDIfNotMay></MTSDIfNotJan> - processing date <> month 5
<MTSDIfNotJun></MTSDIfNotJun> - processing date <> month 6
<MTSDIfNotJul></MTSDIfNotJul> - processing date <> month 7
<MTSDIfNotAug></MTSDIfNotAug> - processing date <> month 8
<MTSDIfNotSep></MTSDIfNotSep> - processing date <> month 9
<MTSDIfNotOct></MTSDIfNotOct> - processing date <> month 10
<MTSDIfNotNov></MTSDIfNotNov> - processing date <> month 11
<MTSDIfNotDec></MTSDIfNotDec> - processing date <> month 12
<MTSDIfMonthEnd></MTSDIfMonthEnd> - last day of each month (MMDD)
<MTSDIfMonthStart></MTSDIfMonthStart> - first day of each month (MMDD = MM01)
<MTSDIfRangeEnd></MTSDIfRangeEnd> - last day of selected range (YYYYMMDDHHMMSS)
<MTSDIfRangeStart></MTSDIfRangeStart> - first day of selected range (YYYYMMDDHHMMSS)
<MTSDIfYearEnd></MTSDIfYearEnd> - last day of the year (MMDD = 1231)
<MTSDIfYearStart></MTSDIfYearStart> - first day of the year (MMDD = 0101)
These are only the changed tags. For a comprehensive tag list, check the documentation in the archive, or use this entry and the last one together.
The most interesting changes are easily the new attributes. These attributes allow you to start (or end) your range with the date of your first (or last) entry. Thus, using something like:
<MTSomeDays date="first" select="since">
Will move back to the very first entry and then process every day since, up to the last day that you have that has published entries. This is important! The since and until attributes are the only ones in SomeDays that work on entries. The data returned is still date driven, but if you wonder why you are not getting entries through today and you are using select="last", it's probably because you haven't done anything for a few days, or perhaps you even publish things in advance.
Using a tag like this along with the new conditionals means that you can easily pull in data from the same day in each week, month or year. For instance, to pull in the entries for each year on this day:
<MTSomeDays date="first" select="since">
<MTSDIfEvalDOY>
<MTEntries>
<$MTEntryDate format="This day in %Y: "$><MTEntryTitle><br />
</MTEntries>
</MTSDIfEvalDOY>
<MTSomeDays>
I know, I know - these pages are way too long and way too confusing. Next task is to make a decent page for an online manual. Hopefully this is the last update to the code for a while, and I'll be able to get that done shortly.

Leave a comment