diff options
author | Evan Winslow <evan.b.winslow@gmail.com> | 2010-10-21 18:45:20 +0000 |
---|---|---|
committer | Evan Winslow <evan.b.winslow@gmail.com> | 2010-10-21 18:45:20 +0000 |
commit | 42db97f9d404179f1d7f4059c891fca7766e482e (patch) | |
tree | f4236c4533281ba34ff55e4305d653be0e09004b /views/default/output/friendlytime.php | |
parent | 9ff9d71952db26c06fe2eb1bf98b53340242e524 (diff) | |
download | elgg-42db97f9d404179f1d7f4059c891fca7766e482e.tar.gz elgg-42db97f9d404179f1d7f4059c891fca7766e482e.tar.bz2 |
Fixed issue with input/form and added output/friendlytime (uses <time> element now)
Diffstat (limited to 'views/default/output/friendlytime.php')
-rw-r--r-- | views/default/output/friendlytime.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/views/default/output/friendlytime.php b/views/default/output/friendlytime.php new file mode 100644 index 000000000..3618e7f56 --- /dev/null +++ b/views/default/output/friendlytime.php @@ -0,0 +1,12 @@ +<?php +/** + * Friendly time + * Translates an epoch time into a human-readable time. + * + * @uses string $vars['time'] Unix-style epoch timestamp + */ + +$friendly_time = elgg_get_friendly_time($vars['time']); +$timestamp = htmlentities(date(elgg_echo('friendlytime:date_format'), $vars['time'])); + +echo "<time title=\"$timestamp\" class=\"timestamp\">$friendly_time</time>"; |