aboutsummaryrefslogtreecommitdiff
path: root/mod/html5/views/default/output
diff options
context:
space:
mode:
Diffstat (limited to 'mod/html5/views/default/output')
-rw-r--r--mod/html5/views/default/output/friendlytime.php14
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>";