Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • seaneo Friend
    #656351

    Hello,

    I was wondering if anyone could point out the way to insert the local tiome under or in the date block on the home page?

    see http://prntscr.com/814fui

    Many thanks,

    Ninja Lead Moderator
    #656474

    You can find and change it from templates/ja_teline_v/tpls/blocks/header.php file


    <div class="col calendar">
    <div class="col-inner">
    <span class="number date"><?php echo date('d') ?></span>
    <div class="text">
    <span class="day"><?php echo JText::_(date('D')) ?></span>, <span class="month"><?php echo JText::_(date('F').'_SHORT') ?></span>
    </div>
    </div>
    </div>

    seaneo Friend
    #658575

    Thanks, Ninja, but is that the code that is already there?
    If so, what could be the additional code to add local server time

    3:15:02 p.m.

    (that shows the seconds moving as a user see it)

    Thanks

    Ninja Lead Moderator
    #658655

    You can try with my tweak as below:

    Open templates/ja_teline_v/tpls/blocks/header.php file

    find and change

    <div class="text">
    <span class="day"><?php echo JText::_(date('D')) ?></span>, <span class="month"><?php echo JText::_(date('F').'_SHORT') ?></span>

    </div>

    to

    <div class="text">
    <?php
    $date = new DateTime();
    $config = JFactory::getConfig();
    $date->setTimezone(new DateTimeZone($config->get('offset')));
    ?>
    <span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?></span>
    </div>

    Ninja Lead Moderator
    #744750

    You can try with my tweak as below:

    Open templates/ja_teline_v/tpls/blocks/header.php file

    find and change

    <div class="text">
    <span class="day"><?php echo JText::_(date('D')) ?></span>, <span class="month"><?php echo JText::_(date('F').'_SHORT') ?></span>

    </div>

    to

    <div class="text">
    <?php
    $date = new DateTime();
    $config = JFactory::getConfig();
    $date->setTimezone(new DateTimeZone($config->get('offset')));
    ?>
    <span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?></span>
    </div>

    seaneo Friend
    #658949

    Thanks Ninja!

    I added <br><br> (the little html i know!) to put some space between the date and time , and then I added one <br> towards the end to get a little more margin space just below the time but it doesnt create that extra space – see http://prntscr.com/81x75z

    The code now is:

    <div class="col-inner">
    <span class="number date"><?php echo date('d') ?></span>
    <div class="text">
    <?php
    $date = new DateTime();
    $config = JFactory::getConfig();
    $date->setTimezone(new DateTimeZone($config->get('offset')));
    ?>
    <span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <br> <br> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?> <br> </span>
    </div>
    </div>

    1) How could I acheive a little more grey space below the time?
    2) Is there a way to make the time clock “live” by incrementing second by second, and minute by minute?
    3) I am working my with web hoster to get the time to be local time in my part of the world, they are telling me to create a PHP.INI file certain content in it. Is that where your code will get the time from?

    Many thanks

    seaneo Friend
    #744800

    Thanks Ninja!

    I added <br><br> (the little html i know!) to put some space between the date and time , and then I added one <br> towards the end to get a little more margin space just below the time but it doesnt create that extra space – see http://prntscr.com/81x75z

    The code now is:

    <div class="col-inner">
    <span class="number date"><?php echo date('d') ?></span>
    <div class="text">
    <?php
    $date = new DateTime();
    $config = JFactory::getConfig();
    $date->setTimezone(new DateTimeZone($config->get('offset')));
    ?>
    <span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <br> <br> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?> <br> </span>
    </div>
    </div>

    1) How could I acheive a little more grey space below the time?
    2) Is there a way to make the time clock “live” by incrementing second by second, and minute by minute?
    3) I am working my with web hoster to get the time to be local time in my part of the world, they are telling me to create a PHP.INI file certain content in it. Is that where your code will get the time from?

    Many thanks

    Ninja Lead Moderator
    #659266

    You can find the solution with your question

    #1) Open templates/ja_teline_v/css/custom.css file (create new if it does not exist) and add new rule


    .calendar span.number.date {
    margin-top: -8px !important;
    }

    .calendar .text {
    margin-top: -4px important;
    }

    #2, 3) You can get your time zone with the setting from Global Configuration backend of your site, see the screenshot

    Ninja Lead Moderator
    #744962

    You can find the solution for your question as below

    #1) Open templates/ja_teline_v/css/custom.css file (create new if it does not exist) and add new rule


    .calendar span.number.date {
    margin-top: -8px !important;
    }

    .calendar .text {
    margin-top: -4px important;
    }

    #2, 3) You can get your time zone with the setting from Global Configuration backend of your site, see the screenshot

    seaneo Friend
    #659665

    Thanks Ninja, I did those twow things and it is perfect.

    The only remaining queston is, do you know how to make the clock “live”?
    So that the seconds and minutes increment in live time in front of a users eyes?

    Thanks,

    Ninja Lead Moderator
    #659732

    @seaneo: Your request is custom work if you are developer, you can apply the solution into your site with for reference here

    seaneo Friend
    #659975

    Unfortunatly I am not a developer, but thank you anyway foir the reference.

    Ok, I retreat, lol..

    One final question, in this code you gave me:

    <div class="text">
    <?php
    $date = new DateTime();
    $config = JFactory::getConfig();
    $date->setTimezone(new DateTimeZone($config->get('offset')));
    ?>
    <span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?></span>
    </div>

    What would be the adjustment to change from:

    10:03:46 AM

    to:

    10:03 AM

    Many thanks,

    seaneo Friend
    #745132

    Unfortunatly I am not a developer, but thank you anyway foir the reference.

    Ok, I retreat, lol..

    One final question, in this code you gave me:

    <div class="text">
    <?php
    $date = new DateTime();
    $config = JFactory::getConfig();
    $date->setTimezone(new DateTimeZone($config->get('offset')));
    ?>
    <span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?></span>
    </div>

    What would be the adjustment to change from:

    10:03:46 AM

    to:

    10:03 AM

    Many thanks,

    Ninja Lead Moderator
    #660043

    You can change as below

    from


    <div class="text">
    <?php
    $date = new DateTime();
    $config = JFactory::getConfig();
    $date->setTimezone(new DateTimeZone($config->get('offset')));
    ?>
    <span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?></span>
    </div>

    to


    <div class="text">
    <?php
    $date = new DateTime();
    $config = JFactory::getConfig();
    $date->setTimezone(new DateTimeZone($config->get('offset')));
    ?>
    <span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i A')) ?></span>
    </div>

    Ninja Lead Moderator
    #745199

    You can change as below

    from


    <div class="text">
    <?php
    $date = new DateTime();
    $config = JFactory::getConfig();
    $date->setTimezone(new DateTimeZone($config->get('offset')));
    ?>
    <span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?></span>
    </div>

    to


    <div class="text">
    <?php
    $date = new DateTime();
    $config = JFactory::getConfig();
    $date->setTimezone(new DateTimeZone($config->get('offset')));
    ?>
    <span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i A')) ?></span>
    </div>

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

This topic contains 15 replies, has 2 voices, and was last updated by  Ninja Lead 9 years, 3 months ago.

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