Question

Im using Timeago plugin to replace date and time with 2 minute ago . After i implement with my php code :

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/0.9.3/jquery.timeago.js" type="text/javascript"></script>
<script>
  jQuery(document).ready(function() {
    jQuery("abbr.timeago").timeago();
  });
</script>

<abbr class="timeago ticket_date" title="<?= date("Y-m-d  h:i:s A", strtotime($ticket_row_message['date_added'])); ?>"><?= date("Y-m-d  h:i:s", strtotime($ticket_row_message['date_added'])); ?></abbr>

The problem that i found is when im hover my mouse to abbr the title only show 2013-03-14 11:06:44 without AM PM. So how to add AM PM, any trick to do this ?

Was it helpful?

Solution

This is really a PHP issue. Your first one is using:

<?= date("Y-m-d  h:i:s A", strtotime($ticket_row_message['date_added'])); ?>

Your second one is using:

<?= date("Y-m-d  h:i:s", strtotime($ticket_row_message['date_added'])); ?>

Just add the "A" to the second one too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top