jquery-timeago icon indicating copy to clipboard operation
jquery-timeago copied to clipboard

A way to 'reset' plugin timer

Open lkuszaj opened this issue 13 years ago • 4 comments

Hello, Not sure if this is a bug or a feature ;) - I have a <time> tag that is updated using ajax but tag text is not getting unpdated using datetime attribute value.

Is there a way to reset plugin timer ? Or get inWords text to updated tag manually ?

lkuszaj avatar Jan 26 '12 15:01 lkuszaj

+1

theshanergy avatar Mar 16 '12 19:03 theshanergy

+1

danimalweb avatar Nov 25 '15 01:11 danimalweb

Looking at the source, it looked like this could be done via $(el).timeago('action') using an action of 'updateFromDOM'.

I am also updating an abbr's title attribute on success of an ajax call, and then doing this after that: $("abbr.timeago").timeago('updateFromDOM');

This achieved resetting the timer based on the updated title value. Hope that helps.

mmccaff avatar Nov 30 '15 21:11 mmccaff

@mmccaff's suggestion worked for me. Thanks!

suomi35 avatar Nov 22 '16 17:11 suomi35