Associated Press formatted date/time Caché Server Page RULE for DTI's Content Publisher system.
More information about the AP style guidelines:
- mah_apstylee (PHP/ExpressionEngine version of this code)
- AP Stylebook
If you imporve upon this code and/or have feedback, please contact me: m@mky.io
<custom:rg:apdatetime timestamp="#(ts)#" />
See apdt.csp for more usage examples.
If you don't use DTI software, but you still want to use this code, then all you have to do is remove these lines of code:
<csr:class super="dt.common.page.Rule" />
<script language="cache" runat="compiler">
do ..RenderDTStartTag()
</script>
<script language="cache" runat="compiler">
do ..RenderDTEndTag()
</script>
- "timestamp" Required. $horolog or ODBC timestamp format.
- "return" What bits of the date do you want returned? Valid choices are 'timeonly', 'dateonly', 'time', 'meridiem', 'day', 'month' and 'year'. Default is the full date and time.
- "year" Set to 'yes' if you want the current year returned. Default is to not return the current year.
- "today" Set to the text you want to return if the day is today. Default is the day number.
- "noon" Set to the the text you want to return if the time is noon. Default is 12.
- "midnight" Set to the text you want to return if the time is midnight. Default is 12.
- "var" Advanced: Name of local variable to use when using as a wrapping tag. Variable name MUST BE UNIQUE!
- 2011/03/30
- Initial public release: Uploaded to GitHub.