ydate (Smarty extension function)
ydate is a Smarty extension function that formats a date or time value according to certain rules:
- if the time is < 91 seconds, it shows "about a minute ago"
- if the time is < 31 minutes, it shows "about X minutes ago"
- if the time is < 91 minutes, it shows "about an hour ago"
- if the time is < 12 hours, it shows "about X hours ago"
- otherwise it displays the date using the userdate function
(where "time" is the diffeence between the current time and the time of the item - usually the creation date/time). The language strings are all configurable in the language file (lang/en_us.ini) but the numbers are actually hard-coded in the Smarty function.
Example:
{$doc_created|ydate:"%Y-%m-%d %H:%S"}
