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

New feature suggestion: Add callback on refresh to be able to modify element

Open bolmaster2 opened this issue 13 years ago • 1 comments
trafficstars

Just added a simple callback function to be able to modify the time element on refresh. I use it to be able to style the date depending on the time. For example adding a class old if the time passed 10 minutes and such...

bolmaster2 avatar Mar 05 '12 15:03 bolmaster2

Wow, this would be awesome. I was coming here to request an event that got fired whenever an element was modified; either way, it'd be great to be able to monitor modifications of the timeago element so that actions can be fired off when the modification meets whatever criteria you're looking for.

(For me, I'm using timeago to show times in the future and in the past, and am looking for a way to know when one of them crosses from the future to the past. Right now, I'm using setInterval to run a script every 500ms that looks at all the timeago elements that contain 'ago' in them, and then making sure I handle those I haven't already discovered... but there HAS to be an easier way!)

delfuego avatar Dec 19 '13 18:12 delfuego