Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum
Welcome, Guest
  • Page:
  • 1

TOPIC: Display Date

Display Date 12 years ago #2718

How do I change the date format? The time now is 23 March 2012 and would like another language version or to display 23-03-2012. Basic News module displays the date very well.

Re: Display Date 12 years ago #2733

  • David Hoang
Dear Jansz

This guide is for theme1.php

Please open modules\mod_sj_news_frontpage\tmpl\theme1.php file, find
<?php if($options->show_date == 1){?>
<p class="yt_date" style="margin: 0 0 3px 0 !important;line-height: normal !important;"><?php echo date("d F Y", strtotime($list[0]['publish'])); ?></p>
<?php } ?>


and change to:

<?php if($options->show_date == 1){?>
<p class="yt_date" style="margin: 0 0 3px 0 !important;line-height: normal !important;"><?php echo JHtml::_('date',strtotime($list[0]['publish']), JText::_('DATE_FORMAT_LC3')); ?></p>
<?php } ?>


Thanks

Re: Display Date 12 years ago #2793

Hello!
Your solution displays the date in correct format. But this is not the date of publication of the article only the current date. See on www.informatorgminny.com
Is there a way to solve it?
Regards

Re: Display Date 12 years ago #2797

  • loitt
  • OFFLINE
  • Platinum Boarder
  • Posts: 2222
  • Karma: 48
Dear Janusz Wójcik,

You can change the date format of module as the following.

Example theme 1, open module mod_sj_news_frontpage/tmpl/them1.php, find:

<p class="yt_date" style="margin: 0 0 3px 0 !important;line-height: normal !important;"><?php echo date("d F Y", strtotime($list[0]['publish'])); ?></p>

==> change to:

<p class="yt_date" style="margin: 0 0 3px 0 !important;line-height: normal !important;"><?php echo JHtml::_('date', $list[0]['publish'], 'd-m-Y'); ?></p>

---------------

<span class="yt_date" style="padding-top: 5px !important;"><?php echo date("d F Y", strtotime($item['publish'])); ?></span>

==> change to:

<span class="yt_date" style="padding-top: 5px !important;"><?php echo JHtml::_('date', $item['publish'], 'd-m-Y'); ?></span>

You can do it for other themes.

If you use the smart news template, you can change the date format as the following steps:

- open site/templates/smart_news25/html/mod_sj_news_frontpage/theme4.php and find:

<?php if($options->show_date == 1){?>

<p style="color:#B7B7B7; font-size:11px; margin:0 !important;display: block !important;"><?php echo date("d F Y", strtotime($list[0]['publish'])); ?></p>

<?php } ?>

==> change to:

<?php if($options->show_date == 1){?>

<p style="color:#B7B7B7; font-size:11px; margin:0 !important;display: block !important;"><?php echo JHtml::_('date', $list[0]['publish'], 'd-m-Y'); ?></p>

<?php } ?>

-----------------------------

<?php if($options->show_date == 1){?>

<span><?php echo date("d F Y", strtotime($item['publish'])); ?></span>

<?php } ?>

==> change to:

<?php if($options->show_date == 1){?>

<span><?php echo JHtml::_('date', $item['publish'], 'd-m-Y'); ?></span>

<?php } ?>

Thanks!
Ticket System | Join our Clubs to download our extensions and templates

Re: Display Date 12 years ago #2798

  • loitt
  • OFFLINE
  • Platinum Boarder
  • Posts: 2222
  • Karma: 48
Dear Janusz Wójcik,

You can change the date format of module as the following.

Example theme 1, open module mod_sj_news_frontpage/tmpl/them1.php, find:

<p class="yt_date" style="margin: 0 0 3px 0 !important;line-height: normal !important;"><?php echo date("d F Y", strtotime($list[0]['publish'])); ?></p>

==> change to:

<p class="yt_date" style="margin: 0 0 3px 0 !important;line-height: normal !important;"><?php echo JHtml::_('date', $list[0]['publish'], 'd-m-Y'); ?></p>

---------------

<span class="yt_date" style="padding-top: 5px !important;"><?php echo date("d F Y", strtotime($item['publish'])); ?></span>

==> change to:

<span class="yt_date" style="padding-top: 5px !important;"><?php echo JHtml::_('date', $item['publish'], 'd-m-Y'); ?></span>

You can do it for other themes.

If you use the smart news template, you can change the date format as the following steps:

- open site/templates/smart_news25/html/mod_sj_news_frontpage/theme4.php and find:

<?php if($options->show_date == 1){?>

<p style="color:#B7B7B7; font-size:11px; margin:0 !important;display: block !important;"><?php echo date("d F Y", strtotime($list[0]['publish'])); ?></p>

<?php } ?>


==> change to:

<?php if($options->show_date == 1){?>

<p style="color:#B7B7B7; font-size:11px; margin:0 !important;display: block !important;"><?php echo JHtml::_('date', $list[0]['publish'], 'd-m-Y'); ?></p>

<?php } ?>

-----------------------------

<?php if($options->show_date == 1){?>

<span><?php echo date("d F Y", strtotime($item['publish'])); ?></span>

<?php } ?>


==> change to:

<?php if($options->show_date == 1){?>

<span><?php echo JHtml::_('date', $item['publish'], 'd-m-Y'); ?></span>

<?php } ?>

Thanks!
Ticket System | Join our Clubs to download our extensions and templates
The following user(s) said Thank You: Janusz

Re: Display Date 12 years ago #2838

Thank you.
He helped the other way. First persistently display the current date.
Regards
  • Page:
  • 1
Time to create page: 0.26 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Home Pricing
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
SearchSupport
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes