I'm trying to combine timeago
with datejs (with help of this to get format for local time)
for timeago
I use the following:
jQuery(document).ready(function() {
jQuery("abbr.timeago").timeago();
});
For the localtime
i use this:
jQuery(document).ready(function() {
$('.UTCTimestamp').localTimeFromUTC('MM/dd/yyyy hh:mm:ss');
});
How do I combine those two together? Right now I'm only able to use one at the time like this:
For Timeago:
<span class='UTCTimestamp'>2011-09-09 10:10:10</span>
and for localtime;
<abbr class='timeago' title='2011-09-09 10:10:10'>2011-09-09 10:10:10</abbr>
don't add any javascript code or jquery code except this;
$('.timeago').timeago();
and then add 'Z' (or including T). for more information go to this link
<abbr class='timeago' title='2011-09-09 10:10:10Z'></abbr>
http://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With