diff options
author | Sem <sembrestels@riseup.net> | 2013-11-09 16:30:07 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2013-11-09 16:30:07 +0100 |
commit | e843405646960ffd1918d8191c5eba6219ba38b3 (patch) | |
tree | 968a62c1fac728f5e0efdce5927fb1b79615e6cc /mod/html5/views/default/output/friendlytime.php | |
parent | dee4ff21a5a5e8b8c5dbeae0a2f89a36a3f1c6cc (diff) | |
parent | b623f64507956f7beee0d8352fd044bdb70f5d23 (diff) | |
download | elgg-e843405646960ffd1918d8191c5eba6219ba38b3.tar.gz elgg-e843405646960ffd1918d8191c5eba6219ba38b3.tar.bz2 |
Add 'mod/html5/' from commit 'b623f64507956f7beee0d8352fd044bdb70f5d23'
git-subtree-dir: mod/html5
git-subtree-mainline: dee4ff21a5a5e8b8c5dbeae0a2f89a36a3f1c6cc
git-subtree-split: b623f64507956f7beee0d8352fd044bdb70f5d23
Diffstat (limited to 'mod/html5/views/default/output/friendlytime.php')
-rw-r--r-- | mod/html5/views/default/output/friendlytime.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mod/html5/views/default/output/friendlytime.php b/mod/html5/views/default/output/friendlytime.php new file mode 100644 index 000000000..dc9699fba --- /dev/null +++ b/mod/html5/views/default/output/friendlytime.php @@ -0,0 +1,14 @@ +<?php +/** + * Friendly time + * Translates an epoch time into a human-readable time. + * + * @uses string $vars['time'] Unix-style epoch timestamp + * @override views/default/output/friendlytime.php + */ + +$friendly_time = elgg_get_friendly_time($vars['time']); +$timestamp = htmlentities(date(elgg_echo('friendlytime:date_format'), $vars['time'])); +$datetime = htmlentities(date("c", $vars['time'])); + +echo "<time title=\"$timestamp\" datetime=\"$datetime\" class=\"timestamp\">$friendly_time</time>"; |