Add date and time, to bottom nav-bar.

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
User avatar
Jay Webb
Veteran Member
Posts: 80
Joined: 2017-08-26 15:27
Contact:

Add date and time, to bottom nav-bar.

Post by Jay Webb » 2017-10-01 23:09

Add this to your "footer-extras.php" it will add the current Month, day and year with an active clock with hours, minutes and seconds.
To place where you want it, play with the panel location 'col-lg-3', or, trying changing navbar-fixed-bottom to navbar-fixed-center or navbar-fixed-top.

<!--begin code>

<div class-"box">
<div class="navbar-fixed-bottom hidden-print alert alert-success panel col-lg-3 text-center">
<?php echo date('F j, Y, '); ?><span id="timer"></span>
</div>
</div>
<script>
setInterval(function() {
var currentTime = new Date ( );
var currentHours = currentTime.getHours ( );
var currentMinutes = currentTime.getMinutes ( );
var currentSeconds = currentTime.getSeconds ( );
currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";
currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;
currentHours = ( currentHours == 0 ) ? 12 : currentHours;
var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;
document.getElementById("timer").innerHTML = currentTimeString;
}, 1000);
</script>

<!--end code-->
What we envision, we make happen.

Post Reply