开发者

Sliding Duration with Javascript or JQuery

开发者_Python百科

Can anyone please suggest, from given date how to calculate sliding duration in javascript or jquery...

I need following output..

- Article published 2 seconds back.
- Article publieshed 1 day back.
- Last modified 3 weeks back..
- Last mondified 1 month back...

Thank you very much.


You're looking for a plugin that does relative or friendly dates. I would recommend the timeago jQuery plugin for this.


jquery animate can do many things.please go through the below api

http://api.jquery.com/animate/

you can even use interval

setInterval(function() //


Take the time in seconds, and divide it by the number of seconds in a year, and that's how many years. Subtract that then divide it by the number of seconds in a month, and that's how many months. Subtract that then divide it by the number of seconds in a week... etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜