methuselah
methuselah

Reputation: 13206

Setting up jquery timeago plugin

I am trying to setup the jQuery timeago plugin with dates in the PHP format:

d/m/Y H:i:s 

but to little success. Here is what I've done so far:

<script>
$(document).ready(function () {
    $("abbr.timeago").timeago();
});
});
</script>

<abbr class="timeago" title="30/01/2013 13:30:06">30/01/2013 13:30:06</abbr>

I've included a fiddle here: http://jsfiddle.net/mc8ft/2/

More information about the timeago plugin can be found here: http://timeago.yarp.com/

Upvotes: 0

Views: 167

Answers (2)

davids
davids

Reputation: 6371

First off, there was a syntax error (the last }); is not needed). Secondly, it seems that the plugin does not accept the date in the format you have it in your fiddle, it should be something like yyyy/mm/dd.

Working example http://jsfiddle.net/mc8ft/4/

Upvotes: 1

Devang Rathod
Devang Rathod

Reputation: 6736

You have a syntax error in your script. remove last });.

<script>
$(document).ready(function () {
   $("abbr.timeago").timeago();
});
</script>

Upvotes: 1

Related Questions