user1027620
user1027620

Reputation: 2785

What's up with jQuery Timeago? I tried everything and still it fails to do anything whatsoever

    <abbr class="timeago" title='<%= DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ") %>'><%= String.Format("{0:MMMM d, yyyy}", DateTime.Now) %></abbr>

+

    $(document).ready(function () {
        $('abbr.timeago').timeago();
    });

=

<abbr class="timeago" title="2011-12-29T00:21:40Z">December 29, 2011</abbr>

Rendered in the browsers as: December 29, 2011.

Why? Thanks.

EDIT:

i've resolved this issue had an error in my console. However, this still fails to do anything when this item is being passed to jquery templates as ${streamObj.DateTime} =>

objStreamItem.DateTime = DateTime.Parse(sqlReader["DateTime"].ToString()).ToString("yyyy-MM-ddTHH:mm:ssZ");

Also, the jquery template is loaded from an external js file which in turn is loaded depending on some other page load criteria.

thanks.

Upvotes: 0

Views: 369

Answers (1)

Šime Vidas
Šime Vidas

Reputation: 185923

It works for me...

HTML:

<abbr class="timeago" title="2011-12-29T00:21:40Z"></abbr>

JavaScript:

$( '.timeago' ).timeago();

Live demo: http://jsfiddle.net/B5ebS/

Your code probably throws an error somewhere causing your program to break...

Upvotes: 1

Related Questions