Skip to content

Instantly share code, notes, and snippets.

View kusakusakusa's full-sized avatar
💭
Digital nomad | RubyOnRails | AWS

Victor Leong kusakusakusa

💭
Digital nomad | RubyOnRails | AWS
View GitHub Profile
@kusakusakusa
kusakusakusa / gist:14986cecadee05e768e5
Created March 19, 2016 09:35 — forked from sulf/gist:1157909
Rails helper time_ago_in_words() and distance_of_time_in_words() translated into JavaScript
var distance_of_time_in_words, time_ago_in_words;
time_ago_in_words = function(from_time, include_seconds) {
if (include_seconds != null) {
include_seconds;
} else {
include_seconds = false;
};
return App.distance_of_time_in_words(from_time, Date.now(), include_seconds);
};
distance_of_time_in_words = function(from_time, to_time, include_seconds) {