Use the gallery helper date/time functions wherever we format date

time for the browser.  Fixes ticket #1278.
This commit is contained in:
Bharat Mediratta
2010-08-08 16:54:31 -07:00
parent cdb6306d7e
commit 2dda8e22a7
5 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -36,11 +36,11 @@
</a>
<? if ($comment->author()->guest): ?>
<?= t('on %date %name said',
array("date" => date("Y-M-d H:i:s", $comment->created),
"name" => html::clean($comment->author_name()))); ?>
array("date" => gallery::date_time($comment->created),
"name" => html::clean($comment->author_name()))); ?>
<? else: ?>
<?= t('on %date <a href="%url">%name</a> said',
array("date" => date("Y-M-d H:i:s", $comment->created),
array("date" => gallery::date_time($comment->created),
"url" => user_profile::url($comment->author_id),
"name" => html::clean($comment->author_name()))); ?>
<? endif ?>
@@ -4,8 +4,8 @@
<? foreach ($comments as $comment): ?>
<li id="g-comment-<?= $comment->id ?>">
<p class="g-author">
<?= t('on %date for %title ',
array("date" => date("Y-M-d H:i:s", $comment->created),
<?= t("on %date for %title ",
array("date" => gallery::date_time($comment->created),
"title" => $comment->item()->title)); ?>
<a href="<?= $comment->item()->url() ?>">
<?= $comment->item()->thumb_img(array(), 50) ?>
+2 -2
View File
@@ -60,7 +60,7 @@ class gallery_Core {
* @return string
*/
static function date_time($timestamp) {
return date(module::get_var("gallery", "date_time_format", "Y-M-d H:i:s"), $timestamp);
return date(module::get_var("gallery", "date_time_format"), $timestamp);
}
/**
@@ -69,7 +69,7 @@ class gallery_Core {
* @return string
*/
static function date($timestamp) {
return date(module::get_var("gallery", "date_format", "Y-M-d"), $timestamp);
return date(module::get_var("gallery", "date_format"), $timestamp);
}
/**
+1 -1
View File
@@ -267,7 +267,7 @@ modules/gallery/views/user_profile.html.php 34 DIRTY_ATTR $use
modules/gallery/views/user_profile.html.php 43 DIRTY $info->view
modules/image_block/views/image_block_block.html.php 3 DIRTY_JS $item->url()
modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class"=>"g-thumbnail"))
modules/info/views/info_block.html.php 22 DIRTY date("M j, Y H:i:s",$item->captured)
modules/info/views/info_block.html.php 22 DIRTY gallery::date_time($item->captured)
modules/info/views/info_block.html.php 29 DIRTY_JS $item->owner->url
modules/notification/views/comment_published.html.php 28 DIRTY_JS $comment->item()->abs_url()
modules/notification/views/comment_published.html.php 29 DIRTY $comment->item()->abs_url()
+1 -1
View File
@@ -19,7 +19,7 @@
<? if ($item->captured): ?>
<li>
<strong class="caption"><?= t("Captured:") ?></strong>
<?= date("M j, Y H:i:s", $item->captured)?>
<?= gallery::date_time($item->captured)?>
</li>
<? endif ?>
<? if ($item->owner): ?>