I want jquery timeago only show me the timeago in days ! I meant when passed 30 days it will show me 31,32,32 days and not 1 month. Thanx for your pront answer.
Asked
Active
Viewed 791 times
1
-
4Which plugin? You have to be more specific. – Blender Oct 03 '12 at 17:37
-
sorry i did meant pluging ! i meant the jquery timeago that you can find here http://timeago.yarp.com/ – morrisonrox Oct 03 '12 at 17:41
1 Answers
1
One solution is to modify the plugin to get the behavior you described. Consider line 83 of jquery.timeago.js:
days < 30 && substitute($l.days, Math.round(days)) ||
As an example, if you change 30
to 40
, like so:
days < 40 && substitute($l.days, Math.round(days)) ||
the plugin will still show "x days ago" up till 39 days ago.
And if you want to disable units bigger than "days" altogether, you could just take out that portion within the assignment of words
, like so:
var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
seconds < 90 && substitute($l.minute, 1) ||
minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||
minutes < 90 && substitute($l.hour, 1) ||
hours < 24 && substitute($l.hours, Math.round(hours)) ||
hours < 42 && substitute($l.day, 1) ||
substitute($l.days, Math.round(days));

Andrew
- 2,770
- 1
- 22
- 29
-
-
@morrisonrox You're very welcome! Please consider accepting my answer by clicking on the giant green checkmark. – Andrew Oct 03 '12 at 18:50