-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhumanize-duration.min.js
1 lines (1 loc) · 15.8 KB
/
humanize-duration.min.js
1
!function(){var n={y:function(n){return 1===n?"χρόνος":"χρόνια"},mo:function(n){return 1===n?"μήνας":"μήνες"},w:function(n){return 1===n?"εβδομάδα":"εβδομάδες"},d:function(n){return 1===n?"μέρα":"μέρες"},h:function(n){return 1===n?"ώρα":"ώρες"},m:function(n){return 1===n?"λεπτό":"λεπτά"},s:function(n){return 1===n?"δευτερόλεπτο":"δευτερόλεπτα"},ms:function(n){return 1===n?"χιλιοστό του δευτερολέπτου":"χιλιοστά του δευτερολέπτου"},decimal:","},k={ar:{y:function(n){return 1===n?"سنة":"سنوات"},mo:function(n){return 1===n?"شهر":"أشهر"},w:function(n){return 1===n?"أسبوع":"أسابيع"},d:function(n){return 1===n?"يوم":"أيام"},h:function(n){return 1===n?"ساعة":"ساعات"},m:function(n){return["دقيقة","دقائق"][function(n){if(n<=2)return 0;if(2<n&&n<11)return 1;return 0}(n)]},s:function(n){return 1===n?"ثانية":"ثواني"},ms:function(n){return 1===n?"جزء من الثانية":"أجزاء من الثانية"},decimal:","},bg:{y:function(n){return["години","година","години"][i(n)]},mo:function(n){return["месеца","месец","месеца"][i(n)]},w:function(n){return["седмици","седмица","седмици"][i(n)]},d:function(n){return["дни","ден","дни"][i(n)]},h:function(n){return["часа","час","часа"][i(n)]},m:function(n){return["минути","минута","минути"][i(n)]},s:function(n){return["секунди","секунда","секунди"][i(n)]},ms:function(n){return["милисекунди","милисекунда","милисекунди"][i(n)]},decimal:","},ca:{y:function(n){return"any"+(1===n?"":"s")},mo:function(n){return"mes"+(1===n?"":"os")},w:function(n){return"setman"+(1===n?"a":"es")},d:function(n){return"di"+(1===n?"a":"es")},h:function(n){return"hor"+(1===n?"a":"es")},m:function(n){return"minut"+(1===n?"":"s")},s:function(n){return"segon"+(1===n?"":"s")},ms:function(n){return"milisegon"+(1===n?"":"s")},decimal:","},cs:{y:function(n){return["rok","roku","roky","let"][o(n)]},mo:function(n){return["měsíc","měsíce","měsíce","měsíců"][o(n)]},w:function(n){return["týden","týdne","týdny","týdnů"][o(n)]},d:function(n){return["den","dne","dny","dní"][o(n)]},h:function(n){return["hodina","hodiny","hodiny","hodin"][o(n)]},m:function(n){return["minuta","minuty","minuty","minut"][o(n)]},s:function(n){return["sekunda","sekundy","sekundy","sekund"][o(n)]},ms:function(n){return["milisekunda","milisekundy","milisekundy","milisekund"][o(n)]},decimal:","},da:{y:"år",mo:function(n){return"måned"+(1===n?"":"er")},w:function(n){return"uge"+(1===n?"":"r")},d:function(n){return"dag"+(1===n?"":"e")},h:function(n){return"time"+(1===n?"":"r")},m:function(n){return"minut"+(1===n?"":"ter")},s:function(n){return"sekund"+(1===n?"":"er")},ms:function(n){return"millisekund"+(1===n?"":"er")},decimal:","},de:{y:function(n){return"Jahr"+(1===n?"":"e")},mo:function(n){return"Monat"+(1===n?"":"e")},w:function(n){return"Woche"+(1===n?"":"n")},d:function(n){return"Tag"+(1===n?"":"e")},h:function(n){return"Stunde"+(1===n?"":"n")},m:function(n){return"Minute"+(1===n?"":"n")},s:function(n){return"Sekunde"+(1===n?"":"n")},ms:function(n){return"Millisekunde"+(1===n?"":"n")},decimal:","},el:n,en:{y:function(n){return"year"+(1===n?"":"s")},mo:function(n){return"month"+(1===n?"":"s")},w:function(n){return"week"+(1===n?"":"s")},d:function(n){return"day"+(1===n?"":"s")},h:function(n){return"hour"+(1===n?"":"s")},m:function(n){return"minute"+(1===n?"":"s")},s:function(n){return"second"+(1===n?"":"s")},ms:function(n){return"millisecond"+(1===n?"":"s")},decimal:"."},es:{y:function(n){return"año"+(1===n?"":"s")},mo:function(n){return"mes"+(1===n?"":"es")},w:function(n){return"semana"+(1===n?"":"s")},d:function(n){return"día"+(1===n?"":"s")},h:function(n){return"hora"+(1===n?"":"s")},m:function(n){return"minuto"+(1===n?"":"s")},s:function(n){return"segundo"+(1===n?"":"s")},ms:function(n){return"milisegundo"+(1===n?"":"s")},decimal:","},et:{y:function(n){return"aasta"+(1===n?"":"t")},mo:function(n){return"kuu"+(1===n?"":"d")},w:function(n){return"nädal"+(1===n?"":"at")},d:function(n){return"päev"+(1===n?"":"a")},h:function(n){return"tund"+(1===n?"":"i")},m:function(n){return"minut"+(1===n?"":"it")},s:function(n){return"sekund"+(1===n?"":"it")},ms:function(n){return"millisekund"+(1===n?"":"it")},decimal:","},fa:{y:"سال",mo:"ماه",w:"هفته",d:"روز",h:"ساعت",m:"دقیقه",s:"ثانیه",ms:"میلی ثانیه",decimal:"."},fi:{y:function(n){return 1===n?"vuosi":"vuotta"},mo:function(n){return 1===n?"kuukausi":"kuukautta"},w:function(n){return"viikko"+(1===n?"":"a")},d:function(n){return"päivä"+(1===n?"":"ä")},h:function(n){return"tunti"+(1===n?"":"a")},m:function(n){return"minuutti"+(1===n?"":"a")},s:function(n){return"sekunti"+(1===n?"":"a")},ms:function(n){return"millisekunti"+(1===n?"":"a")},decimal:","},fr:{y:function(n){return"an"+(2<=n?"s":"")},mo:"mois",w:function(n){return"semaine"+(2<=n?"s":"")},d:function(n){return"jour"+(2<=n?"s":"")},h:function(n){return"heure"+(2<=n?"s":"")},m:function(n){return"minute"+(2<=n?"s":"")},s:function(n){return"seconde"+(2<=n?"s":"")},ms:function(n){return"milliseconde"+(2<=n?"s":"")},decimal:","},gr:n,hr:{y:function(n){return n%10==2||n%10==3||n%10==4?"godine":"godina"},mo:function(n){return 1===n?"mjesec":2===n||3===n||4===n?"mjeseca":"mjeseci"},w:function(n){return n%10==1&&11!==n?"tjedan":"tjedna"},d:function(n){return 1===n?"dan":"dana"},h:function(n){return 1===n?"sat":2===n||3===n||4===n?"sata":"sati"},m:function(n){var t=n%10;return 2!=t&&3!=t&&4!=t||!(n<10||14<n)?"minuta":"minute"},s:function(n){return 10===n||11===n||12===n||13===n||14===n||16===n||17===n||18===n||19===n||n%10==5?"sekundi":n%10==1?"sekunda":n%10==2||n%10==3||n%10==4?"sekunde":"sekundi"},ms:function(n){return 1===n?"milisekunda":n%10==2||n%10==3||n%10==4?"milisekunde":"milisekundi"},decimal:","},hu:{y:"év",mo:"hónap",w:"hét",d:"nap",h:"óra",m:"perc",s:"másodperc",ms:"ezredmásodperc",decimal:","},id:{y:"tahun",mo:"bulan",w:"minggu",d:"hari",h:"jam",m:"menit",s:"detik",ms:"milidetik",decimal:"."},is:{y:"ár",mo:function(n){return"mánuð"+(1===n?"ur":"ir")},w:function(n){return"vik"+(1===n?"a":"ur")},d:function(n){return"dag"+(1===n?"ur":"ar")},h:function(n){return"klukkutím"+(1===n?"i":"ar")},m:function(n){return"mínút"+(1===n?"a":"ur")},s:function(n){return"sekúnd"+(1===n?"a":"ur")},ms:function(n){return"millisekúnd"+(1===n?"a":"ur")},decimal:"."},it:{y:function(n){return"ann"+(1===n?"o":"i")},mo:function(n){return"mes"+(1===n?"e":"i")},w:function(n){return"settiman"+(1===n?"a":"e")},d:function(n){return"giorn"+(1===n?"o":"i")},h:function(n){return"or"+(1===n?"a":"e")},m:function(n){return"minut"+(1===n?"o":"i")},s:function(n){return"second"+(1===n?"o":"i")},ms:function(n){return"millisecond"+(1===n?"o":"i")},decimal:","},ja:{y:"年",mo:"月",w:"週",d:"日",h:"時間",m:"分",s:"秒",ms:"ミリ秒",decimal:"."},ko:{y:"년",mo:"개월",w:"주일",d:"일",h:"시간",m:"분",s:"초",ms:"밀리 초",decimal:"."},lo:{y:"ປີ",mo:"ເດືອນ",w:"ອາທິດ",d:"ມື້",h:"ຊົ່ວໂມງ",m:"ນາທີ",s:"ວິນາທີ",ms:"ມິນລິວິນາທີ",decimal:","},lt:{y:function(n){return n%10==0||10<=n%100&&n%100<=20?"metų":"metai"},mo:function(n){return["mėnuo","mėnesiai","mėnesių"][c(n)]},w:function(n){return["savaitė","savaitės","savaičių"][c(n)]},d:function(n){return["diena","dienos","dienų"][c(n)]},h:function(n){return["valanda","valandos","valandų"][c(n)]},m:function(n){return["minutė","minutės","minučių"][c(n)]},s:function(n){return["sekundė","sekundės","sekundžių"][c(n)]},ms:function(n){return["milisekundė","milisekundės","milisekundžių"][c(n)]},decimal:","},lv:{y:function(n){return["gads","gadi"][m(n)]},mo:function(n){return["mēnesis","mēneši"][m(n)]},w:function(n){return["nedēļa","nedēļas"][m(n)]},d:function(n){return["diena","dienas"][m(n)]},h:function(n){return["stunda","stundas"][m(n)]},m:function(n){return["minūte","minūtes"][m(n)]},s:function(n){return["sekunde","sekundes"][m(n)]},ms:function(n){return["milisekunde","milisekundes"][m(n)]},decimal:","},ms:{y:"tahun",mo:"bulan",w:"minggu",d:"hari",h:"jam",m:"minit",s:"saat",ms:"milisaat",decimal:"."},nl:{y:"jaar",mo:function(n){return 1===n?"maand":"maanden"},w:function(n){return 1===n?"week":"weken"},d:function(n){return 1===n?"dag":"dagen"},h:"uur",m:function(n){return 1===n?"minuut":"minuten"},s:function(n){return 1===n?"seconde":"seconden"},ms:function(n){return 1===n?"milliseconde":"milliseconden"},decimal:","},no:{y:"år",mo:function(n){return"måned"+(1===n?"":"er")},w:function(n){return"uke"+(1===n?"":"r")},d:function(n){return"dag"+(1===n?"":"er")},h:function(n){return"time"+(1===n?"":"r")},m:function(n){return"minutt"+(1===n?"":"er")},s:function(n){return"sekund"+(1===n?"":"er")},ms:function(n){return"millisekund"+(1===n?"":"er")},decimal:","},pl:{y:function(n){return["rok","roku","lata","lat"][e(n)]},mo:function(n){return["miesiąc","miesiąca","miesiące","miesięcy"][e(n)]},w:function(n){return["tydzień","tygodnia","tygodnie","tygodni"][e(n)]},d:function(n){return["dzień","dnia","dni","dni"][e(n)]},h:function(n){return["godzina","godziny","godziny","godzin"][e(n)]},m:function(n){return["minuta","minuty","minuty","minut"][e(n)]},s:function(n){return["sekunda","sekundy","sekundy","sekund"][e(n)]},ms:function(n){return["milisekunda","milisekundy","milisekundy","milisekund"][e(n)]},decimal:","},pt:{y:function(n){return"ano"+(1===n?"":"s")},mo:function(n){return 1===n?"mês":"meses"},w:function(n){return"semana"+(1===n?"":"s")},d:function(n){return"dia"+(1===n?"":"s")},h:function(n){return"hora"+(1===n?"":"s")},m:function(n){return"minuto"+(1===n?"":"s")},s:function(n){return"segundo"+(1===n?"":"s")},ms:function(n){return"milissegundo"+(1===n?"":"s")},decimal:","},ro:{y:function(n){return 1===n?"an":"ani"},mo:function(n){return 1===n?"lună":"luni"},w:function(n){return 1===n?"săptămână":"săptămâni"},d:function(n){return 1===n?"zi":"zile"},h:function(n){return 1===n?"oră":"ore"},m:function(n){return 1===n?"minut":"minute"},s:function(n){return 1===n?"secundă":"secunde"},ms:function(n){return 1===n?"milisecundă":"milisecunde"},decimal:","},ru:{y:function(n){return["лет","год","года"][i(n)]},mo:function(n){return["месяцев","месяц","месяца"][i(n)]},w:function(n){return["недель","неделя","недели"][i(n)]},d:function(n){return["дней","день","дня"][i(n)]},h:function(n){return["часов","час","часа"][i(n)]},m:function(n){return["минут","минута","минуты"][i(n)]},s:function(n){return["секунд","секунда","секунды"][i(n)]},ms:function(n){return["миллисекунд","миллисекунда","миллисекунды"][i(n)]},decimal:","},uk:{y:function(n){return["років","рік","роки"][i(n)]},mo:function(n){return["місяців","місяць","місяці"][i(n)]},w:function(n){return["тижнів","тиждень","тижні"][i(n)]},d:function(n){return["днів","день","дні"][i(n)]},h:function(n){return["годин","година","години"][i(n)]},m:function(n){return["хвилин","хвилина","хвилини"][i(n)]},s:function(n){return["секунд","секунда","секунди"][i(n)]},ms:function(n){return["мілісекунд","мілісекунда","мілісекунди"][i(n)]},decimal:","},ur:{y:"سال",mo:function(n){return 1===n?"مہینہ":"مہینے"},w:function(n){return 1===n?"ہفتہ":"ہفتے"},d:"دن",h:function(n){return 1===n?"گھنٹہ":"گھنٹے"},m:"منٹ",s:"سیکنڈ",ms:"ملی سیکنڈ",decimal:"."},sk:{y:function(n){return["rok","roky","roky","rokov"][o(n)]},mo:function(n){return["mesiac","mesiace","mesiace","mesiacov"][o(n)]},w:function(n){return["týždeň","týždne","týždne","týždňov"][o(n)]},d:function(n){return["deň","dni","dni","dní"][o(n)]},h:function(n){return["hodina","hodiny","hodiny","hodín"][o(n)]},m:function(n){return["minúta","minúty","minúty","minút"][o(n)]},s:function(n){return["sekunda","sekundy","sekundy","sekúnd"][o(n)]},ms:function(n){return["milisekunda","milisekundy","milisekundy","milisekúnd"][o(n)]},decimal:","},sv:{y:"år",mo:function(n){return"månad"+(1===n?"":"er")},w:function(n){return"veck"+(1===n?"a":"or")},d:function(n){return"dag"+(1===n?"":"ar")},h:function(n){return"timm"+(1===n?"e":"ar")},m:function(n){return"minut"+(1===n?"":"er")},s:function(n){return"sekund"+(1===n?"":"er")},ms:function(n){return"millisekund"+(1===n?"":"er")},decimal:","},tr:{y:"yıl",mo:"ay",w:"hafta",d:"gün",h:"saat",m:"dakika",s:"saniye",ms:"milisaniye",decimal:","},th:{y:"ปี",mo:"เดือน",w:"อาทิตย์",d:"วัน",h:"ชั่วโมง",m:"นาที",s:"วินาที",ms:"มิลลิวินาที",decimal:"."},vi:{y:"năm",mo:"tháng",w:"tuần",d:"ngày",h:"giờ",m:"phút",s:"giây",ms:"mili giây",decimal:","},zh_CN:{y:"年",mo:"个月",w:"周",d:"天",h:"小时",m:"分钟",s:"秒",ms:"毫秒",decimal:"."},zh_TW:{y:"年",mo:"個月",w:"周",d:"天",h:"小時",m:"分鐘",s:"秒",ms:"毫秒",decimal:"."}};function t(n){var u=function(n,t){return function(n,t){var u,r,e;n=Math.abs(n);var i,o,c,m=function(n){var t=[n.language];if(v(n,"fallbacks")){if(!w(n.fallbacks)||!n.fallbacks.length)throw new Error("fallbacks must be an array with at least one element");t=t.concat(n.fallbacks)}for(var u=0;u<t.length;u++){var r=t[u];if(v(n.languages,r))return n.languages[r];if(v(k,r))return k[r]}throw new Error("No language found.")}(t),s=[];for(u=0,r=t.units.length;u<r;u++){if(i=t.units[u],o=t.unitMeasures[i],u+1===r)if(v(t,"maxDecimalPoints")){var a=Math.pow(10,t.maxDecimalPoints),f=n/o;c=parseFloat((Math.floor(a*f)/a).toFixed(t.maxDecimalPoints))}else c=n/o;else c=Math.floor(n/o);s.push({unitCount:c,unitName:i}),n-=c*o}var d,l,h=0;for(u=0;u<s.length;u++)if(s[u].unitCount){h=u;break}if(t.round)for(u=s.length-1;0<=u&&((e=s[u]).unitCount=Math.round(e.unitCount),0!==u);u--)l=s[u-1],d=t.unitMeasures[l.unitName]/t.unitMeasures[e.unitName],(e.unitCount%d==0||t.largest&&t.largest-1<u-h)&&(l.unitCount+=e.unitCount/d,e.unitCount=0);var y=[];for(u=0,s.length;u<r&&((e=s[u]).unitCount&&y.push(g(e.unitCount,e.unitName,m,t)),y.length!==t.largest);u++);{if(!y.length)return g(0,t.units[t.units.length-1],m,t);if(!t.conjunction||1===y.length)return y.join(t.delimiter);if(2===y.length)return y.join(t.conjunction);if(2<y.length)return y.slice(0,-1).join(t.delimiter)+(t.serialComma?",":"")+t.conjunction+y.slice(-1)}}(n,r({},u,t||{}))};return r(u,{language:"en",delimiter:", ",spacer:" ",conjunction:"",serialComma:!0,units:["y","mo","w","d","h","m","s"],languages:{},round:!1,unitMeasures:{y:315576e5,mo:26298e5,w:6048e5,d:864e5,h:36e5,m:6e4,s:1e3,ms:1}},n)}var u=t({});function g(n,t,u,r){var e;e=void 0===r.decimal?u.decimal:r.decimal;var i,o=n.toString().replace(".",e),c=u[t];return i="function"==typeof c?c(n):c,o+r.spacer+i}function r(n){for(var t,u=1;u<arguments.length;u++)for(var r in t=arguments[u])v(t,r)&&(n[r]=t[r]);return n}function e(n){return 1===n?0:Math.floor(n)!==n?1:2<=n%10&&n%10<=4&&!(10<n%100&&n%100<20)?2:3}function i(n){return Math.floor(n)!==n?2:5<=n%100&&n%100<=20||5<=n%10&&n%10<=9||n%10==0?0:n%10==1?1:1<n?2:0}function o(n){return 1===n?0:Math.floor(n)!==n?1:2<=n%10&&n%10<=4&&n%100<10?2:3}function c(n){return 1===n||n%10==1&&20<n%100?0:Math.floor(n)!==n||2<=n%10&&20<n%100||2<=n%10&&n%100<10?1:2}function m(n){return 1===n||n%10==1&&n%100!=11?0:1}var w=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function v(n,t){return Object.prototype.hasOwnProperty.call(n,t)}u.getSupportedLanguages=function(){var n=[];for(var t in k)v(k,t)&&"gr"!==t&&n.push(t);return n},u.humanizer=t,"function"==typeof define&&define.amd?define(function(){return u}):"undefined"!=typeof module&&module.exports?module.exports=u:this.humanizeDuration=u}();