Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • Pankaj Sharma Moderator
    #811903

    Hi
    This way will help you to do that

    Open templates/ja_magz/templateHelper.php file
    Find this code

      public static function relTime($timespan, $granularity = 1) {
        static $units = array(
          'YEAR' => 31536000,
          'MONTH' => 2592000,
          'WEEK' => 604800,
          'DAY' => 86400,
          'HOUR' => 3600,
          'MIN' => 60,
          'SEC' => 1,
        );
    

    Replace it with

    return JText::sprintf(JHtml::_('date', $timespan, JText::_('DATE_FORMAT_LC3')));
    static $units = array(
    'YEAR' => 31536000,
    'MONTH' => 2592000,
    'WEEK' => 604800,
    'DAY' => 86400,
    'HOUR' => 3600,
    'MIN' => 60,
    'SEC' => 1,
    );

    Let me know if it helps

    idhla Friend
    #828065

    Brilliant! Thanks for your help!

    rwlfr Friend
    #843198

    I’m sorry it doesn’t work for me (I’m using the Magz II template)

    Can you confirm the file is this one :
    templates/ja_magz_ii/Helper.php

    When I change the code, I get this error :
    Parse error: syntax error, unexpected ‘return’ (T_RETURN), expecting function (T_FUNCTION)

    Pankaj Sharma Moderator
    #843549

    Hi
    it looks like php lib on your localhost (server) is missing
    php lib return function does not exist . Enable it . the file is correct and its working fine for us and users as u can see in this thread.

    victoradrian Friend
    #851781

    Hi Pankaj Charman,

    This code didn’t work for me either, when I make the change it broke the page, can you please help me with it, couse I really need to do it.

    Thanks,

    Pankaj Sharma Moderator
    #852145

    Hi Vic.
    Kindly share the details of error you are getting , If you error is same like above mentioned by user kindly check this post .

    victoradrian Friend
    #854765

    Hi Pankaj,
    Here is the result of my pages after I paste the code you share above.

    And I don’t know how to enable the php lib, in my server, if you tell me I’ll try.

    Thanks for your help.


    1. Screen-Shot-2016-01-19-at-10.01.54-AM
    2. Screen-Shot-2016-01-19-at-10.02.09-AM
    Pankaj Sharma Moderator
    #860193

    Hi victoradrian
    I do not see the error on your site , Could u make the site live and share the details via Private reply , so i can check it .

    victoradrian Friend
    #863282
    This reply has been marked as private.
    Pankaj Sharma Moderator
    #863872

    Hi victoradrian
    My account does not have permission to check the issue on your site . Kindly upgrade the user account to super user access .

    victoradrian Friend
    #864967
    This reply has been marked as private.
    Pankaj Sharma Moderator
    #865028

    Hi
    Victor.
    I fixed it directly on your site , Kindly check ,date format is changed now .

    victoradrian Friend
    #865446
    This reply has been marked as private.
    Pankaj Sharma Moderator
    #865484

    Hi
    Victor could share url where and how i can check this code on your site ?

    Pankaj Sharma Moderator
    #865487

    Hi
    Glad to hear you sorted it out .
    If you have any doubt and question in future do

Viewing 15 posts - 1 through 15 (of 22 total)

This topic contains 22 replies, has 5 voices, and was last updated by  noticiascelta 8 years ago.

The topic ‘How to change the date format’ is closed to new replies.