Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • palos Friend
    #195999

    e.g. JA News Pro Module and others follow nice the translated date format but JA News Featured
    – forget the dot after the number of day,
    – forget the name of the day,
    – but put a leading zero to the one-digit days what is not right here… or I just do not need it.

    Where is it hardcoded?
    I found a lot of folders and files in …/modules/mod_janews_featured but none of them contains a date or a createdate string. (or just I do not find them)

    I need 2014. March 7. Friday but it displays 2014. March 07

    Ninja Lead Moderator
    #527637

    You can find and change the date format of JA News Featured in the templates/your_nex_template/html/mod_janews_featured/nex/blog.php file. You can edit this code:

    <span class="createdate">
    <?php echo JHTML::_('date', $news->created, JText::_('DATE_FORMAT_LC3')); ?>
    </span>

    With DATE_FORMAT_LC3=”d F Y”

    You can change to format: 2014. March 7. Friday

    palos Friend
    #528140

    Thank you, Ninja Lead!

    It is in the line 155 and we should change it like below if we need the format I mentioned above

    <?php echo JHTML::_('date', $news->created, JText::_('Y. F j. l')); ?>

    There is also a line at 257 what is responsible for the three normal (not featured) article’s date format:

    <?php echo JHTML::_('date', $news->created, JText::_('Y. F j.')); ?>
    Just cancelled using the full textual representation of the day of the week here as it would be too long…
    And used “j” what shows the Day of the month without leading zeros

    Some help here

    It is still odd for me that there are many of your module offer these settings at their backend. But not all.
    The worst that we have already the J3.2.3 and it is still facing this kind of issues what should have been solved almost nine years ago.

    Ninja Lead Moderator
    #528214

    If you want to sort day of the week, please try solution below:

    <?php
    $day_of_week = array('', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat','Sun');
    echo JHTML::_('date', $news->created, JText::_('Y. F j.'))." ". $day_of_week[JHTML::_('date', $news->created, JText::_('N'))];
    ?>

    It should display: 2011. DECEMBER 10. SAT

    Let me know if it helps.

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 2 voices, and was last updated by  Ninja Lead 10 years, 8 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum