LegacyDate::setTemplate - jcobban/Genealogy GitHub Wiki
$date->setTemplate($string)
Up: class LegacyDate
Change the template string used to format dates for presentation to the user.
parameter | description |
---|---|
$string | string containing substitution tags as defined below |
This consists of text and substitution points for information from the date. Substitutions are identified by codes enclosed in square brackets:
code | description |
---|---|
dd | day of month as a number. This uses the Julian Calendar prior to 4 Oct 1582. |
ddord | day of month as an ordinal number, for example "16th", "21st" |
OSdd | day of month as a number, Julian calendar after 4 Oct 1582. |
Mon | 3 character abbreviation for month name. This uses the Julian Calendar prior to 4 Oct 1582, and the Gregorian Calendar from 15 Oct 1582 on. |
OSMon | 3 character abbreviation for month name using the Julian calendar after 4 Oct 1582 |
Month | full month name. This uses the Julian Calendar prior to 4 Oct 1582, and the Gregorian Calendar from 15 Oct 1582 on. |
OSMonth | full month name, Julian calendar after 1582 |
yyyy | year numeric using Indo-Arabic numerals with the year starting 1 Jan. This uses the Julian Calendar prior to 4 Oct 1582, and the Gregorian Calendar from 15 Oct 1582 on with the year starting at 1 Jan. |
xxxx | year expressed in Roman numerals, for example MCMLXXXVI for 1986. This uses the Julian Calendar prior to 4 Oct 1582, and the Gregorian Calendar from 15 Oct 1582 on with the year starting at 1 Jan. |
OSyyyy | year numeric using Indo-Arabic numerals, English Old Style: Julian Calendar with year starting on 25th March |
BC | display "BC" if year less than 1 AD |
AD | display "AD" if year greater than or equal to 1 AD |
BCE | display "BCE" if year less than 1 AD |
CE | display "CE" if year greater than or equal to 1 AD |
For example [dd] [Month] [yyyy]
or [Mon] [ddord], [yyyy]
.
For compatibility with the way substitutions are defined in page templates in class Template support for PERL style substitutions is under development. For example $dd $Month $yyy
or $Mon $ddord, $yyyy
.
Next: $date->getDay()