开发者

Sliding Duration with Javascript or JQuery

开发者 https://www.devze.com 2023-01-24 19:23 出处:网络
开发者_Python百科Can anyone please suggest, from given date how to calculate sliding duration in 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

精彩评论

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