Home > custom.rg.ApDateTimeRule

custom.rg.ApDateTimeRule

Custom.rg.ApDateTimeRule is a project mainly written in ..., it's free.

Associated Press formatted date/time Caché Server Page RULE for DTI's Content Publisher system.

About:

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:

micky (.) hulse [at] registerguard (.) com.

Basic usage:

<custom:rg:apdatetime timestamp="#(ts)#" />

See apdt.csp for more usage examples.

Non DTI customers:

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>

Rule parameters:

  • "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!

Changelog:

  • 2011/03/30
    • Initial public release: Uploaded to GitHub.
Previous:purest