Skip to content

Instantly share code, notes, and snippets.

@bostrt
bostrt / fuzzytime_again.js
Last active January 3, 2016 09:49
fuzzytime rewrite
(function(root){
'use strict';
var FuzzyTime = function() {
this.ats = [];
this.befores = [];
this.afters = [];
};
@bostrt
bostrt / fuzzytime.md
Last active December 25, 2015 04:49
making my fuzzy time "spec" public

I think that I may have come up with a great way to show users "fuzzy" times like: a minute ago, 2 and a half hours ago, in a few minutes, etc.... It looks like the best solution now is a jQuery plugin called timeago, hopefully my idea will improve up timeago's solution. See psuedo-code interface (looks like Java) and examples below. Note that this interface looks like Java, but it may be implemented in any laguage.

enum Unit {
  SECOND, MINUTE, HOUR, DAY, MONTH, YEAR, etc...
}

class Fuzzy {
  // Contains date-time comparison logic based on