Sha256: 20d6c263ee40de6c9874c21b6f28380768d4b61f77ee0df5d550509e484eef87
Contents?: true
Size: 1.5 KB
Versions: 21
Compression:
Stored size: 1.5 KB
Contents
o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1333042173.221189 'ö:@value{ I"length:EFiI"digest; F"%ecdff3e8a7af67268059502367a681d2I"source; FI"// Thanks, http://www.harukizaemon.com/2008/05/javascript-date-helpers.html Date.prototype.distanceOfTimeInWords = function(to) { distance_in_milliseconds = to - this; distance_in_minutes = Math.round(Math.abs(distance_in_milliseconds / 60000)); if (distance_in_minutes == 0) { words = "less than a minute"; } else if (distance_in_minutes == 1) { words = "1 minute"; } else if (distance_in_minutes < 45) { words = distance_in_minutes + " minutes"; } else if (distance_in_minutes < 90) { words = "about 1 hour"; } else if (distance_in_minutes < 1440) { words = "about " + Math.round(distance_in_minutes / 60) + " hours"; } else if (distance_in_minutes < 2160) { words = "about 1 day"; } else if (distance_in_minutes < 43200) { words = Math.round(distance_in_minutes / 1440) + " days"; } else if (distance_in_minutes < 86400) { words = "about 1 month"; } else if (distance_in_minutes < 525600) { words = Math.round(distance_in_minutes / 43200) + " months"; } else if (distance_in_minutes < 1051200) { words = "about 1 year"; } else { words = "over " + Math.round(distance_in_minutes / 525600) + " years"; } return words; }; Date.prototype.timeAgoInWords = function() { return this.distanceOfTimeInWords(new Date()); }; ; FI" _version; F"%6fe10927fff8ab98af2dcd1a74bd9131
Version data entries
21 entries across 21 versions & 1 rubygems