Files
PyRIGS/RIGS/static/js/moment-twitter.js
2020-03-07 23:00:45 +00:00

1 line
909 B
JavaScript

(function(){var s,e;s={seconds:{short:"s",long:" sec"},minutes:{short:"m",long:" min"},hours:{short:"h",long:" hr"},days:{short:"d",long:" day"}},e=function(r){var t;return t=function(t){var e,n,o,i;if(n=o=null,(e=Math.abs(this.diff(r())))<=1e3)o="seconds",n=1;else if(e<6e4)o="seconds";else if(e<36e5)o="minutes";else if(e<864e5)o="hours";else{if("short"!==t)return this.format("MMM D");if(!(e<6048e5))return this.format("M/D/YY");o="days"}return n&&o||(n=r.duration(e)[o]()),i=o=s[o][t],"long"===t&&1<n&&(i+="s"),n+i},r.fn.twitterLong=function(){return t.call(this,"long")},r.fn.twitter=r.fn.twitterShort=function(){return t.call(this,"short")},r},"function"==typeof define&&define.amd?define("moment-twitter",["moment"],function(t){return this.moment=e(t)}):"undefined"!=typeof module?module.exports=e(require("moment")):"undefined"!=typeof window&&window.moment&&(this.moment=e(this.moment))}).call(this);