adamb
adamb

Reputation: 4883

Opposite of timeago.js?

I found a nifty little time-to-text jQuery plugin called timeago.js (think Twitter timestamps.) It's not a complex plugin, but it saves good dev time, and I especially like that it auto-updates.

Only problem is, I need this functionality to work for dates in the future, not just the past. (i.e. "timeuntil.js"?)

Has anyone come across a plugin (or they're own solution) that emulates the functionality described?

Upvotes: 0

Views: 472

Answers (2)

user578895
user578895

Reputation:

Um... Just change "ago" to "from now" or whatever and flip the order of the dates

[edit] Or just bother to read the documentation a little bit :)

jQuery.timeago.settings.allowFuture = true;

Upvotes: 3

bevacqua
bevacqua

Reputation: 48476

Try out momentjs, it's far better than any other js date libraries out there

Upvotes: 1

Related Questions