summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/helpers/gallery.php27
-rw-r--r--modules/gallery/views/admin_block_log_entries.html.php2
-rw-r--r--modules/gallery/views/admin_maintenance.html.php4
3 files changed, 30 insertions, 3 deletions
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php
index 1686571c..e201fded 100644
--- a/modules/gallery/helpers/gallery.php
+++ b/modules/gallery/helpers/gallery.php
@@ -49,4 +49,31 @@ class gallery_Core {
static function shutdown() {
module::event("gallery_shutdown");
}
+
+ /**
+ * Return a unix timestamp in a user specified format including date and time.
+ * @param $timestamp unix timestamp
+ * @return string
+ */
+ static function date_time($timestamp) {
+ return date("Y-M-d H:i:s", $timestamp);
+ }
+
+ /**
+ * Return a unix timestamp in a user specified format that's just the date.
+ * @param $timestamp unix timestamp
+ * @return string
+ */
+ static function date($timestamp) {
+ return date("Y-M-d", $timestamp);
+ }
+
+ /**
+ * Return a unix timestamp in a user specified format that's just the time.
+ * @param $timestamp unix timestamp
+ * @return string
+ */
+ static function time($timestamp) {
+ return date("H:i:s", $timestamp);
+ }
} \ No newline at end of file
diff --git a/modules/gallery/views/admin_block_log_entries.html.php b/modules/gallery/views/admin_block_log_entries.html.php
index 38070fe1..44c1657f 100644
--- a/modules/gallery/views/admin_block_log_entries.html.php
+++ b/modules/gallery/views/admin_block_log_entries.html.php
@@ -3,7 +3,7 @@
<? foreach ($entries as $entry): ?>
<li class="<?= log::severity_class($entry->severity) ?>" style="direction: ltr">
<a href="<?= url::site("user/$entry->user_id") ?>"><?= p::clean($entry->user->name) ?></a>
- <?= date("Y-M-d H:i:s", $entry->timestamp) ?>
+ <?= gallery::date_time($entry->timestamp) ?>
<?= $entry->message ?>
<?= $entry->html ?>
</li>
diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php
index 66c4eea0..c47f77f8 100644
--- a/modules/gallery/views/admin_maintenance.html.php
+++ b/modules/gallery/views/admin_maintenance.html.php
@@ -69,7 +69,7 @@
<? foreach ($running_tasks as $task): ?>
<tr class="<?= $task->state == "stalled" ? "gWarning" : "" ?>">
<td>
- <?= date("M j, Y H:i:s", $task->updated) ?>
+ <?= gallery::date_time($task->updated) ?>
</td>
<td>
<?= $task->name ?>
@@ -139,7 +139,7 @@
<? foreach ($finished_tasks as $task): ?>
<tr class="<?= $task->state == "success" ? "gSuccess" : "gError" ?>">
<td>
- <?= date("M j, Y H:i:s", $task->updated) ?>
+ <?= gallery::date_time($task->updated) ?>
</td>
<td>
<?= $task->name ?>