New feature: Cutoff time for applying inWords #21

wants to merge 1 commit into


None yet

4 participants

msolli commented Oct 27, 2010

I wanted to control when timeago applies inWords. Older dates should appear with their original representation, and newer dates, for instance newer than a week, should get the fuzzy timestamp.

This commit adds a setting, cutoff, that can be set to the number of milliseconds that marks the cutoff between using the original and the fuzzy date.

I've tried to use your coding style, and passing tests are included, even if this is the first time I've written Javascript unit tests. Hope you can use it!


@msolli msolli Cutoff setting for leaving older dates alone.
The cutoff setting, if set to something other than 0, ensures that dates
older than this number of milliseconds is not touched by timeago.
pkyeck commented Nov 2, 2012

+1 this is definitely missing

+1, pretty cool feature.

rmm5t commented Mar 7, 2013

Sorry, I haven't done a great job of monitoring most of these PRs lately, but I'm about to refocus some efforts to this library again in an effort for a 2.0 release (might be a full rewrite). In the meantime, if someone can rebase this, I'll pull it in and release a new 1.x release.

rmm5t commented Mar 7, 2013

Also, it's worth noting that this feature isn't really necessary. You can always opt to avoid the class on the time elements that are older than a particular date from the server side. That, or add a cutoff class for older elements server side. However, this is an often asked for feature, so I'll concede, especially for the case where content is more static. I'm going to consolidate all the related issues/PRs toward this implementation to get it rebased and pulled in.

@rmm5t rmm5t closed this in #129 May 18, 2013
rmm5t commented May 18, 2013

Long time no action, but v1.2.0 now incorporates this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment