vague-time
Advanced tools
Comparing version 1.3.1 to 1.3.2
{ | ||
"name": "vague-time", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"main": "./lib/vagueTime.js", | ||
@@ -5,0 +5,0 @@ "ignore": [ |
{ | ||
"name": "vague-time", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "A tiny library that formats precise time differences as a vague/fuzzy time. Supports 10 languages.", | ||
@@ -5,0 +5,0 @@ "repo": "philbooth/vagueTime.js", |
@@ -150,2 +150,1 @@ /** | ||
}(this)); | ||
@@ -149,2 +149,1 @@ /** | ||
}(this)); | ||
@@ -149,2 +149,1 @@ /** | ||
}(this)); | ||
@@ -171,2 +171,1 @@ /** | ||
}(this)); | ||
@@ -170,2 +170,1 @@ /** | ||
}(this)); | ||
@@ -170,2 +170,1 @@ /** | ||
}(this)); | ||
@@ -171,2 +171,1 @@ /** | ||
}(this)); | ||
@@ -170,2 +170,1 @@ /** | ||
}(this)); | ||
@@ -42,23 +42,24 @@ /** | ||
}, | ||
jp: { | ||
year: [ '年', '年' ], | ||
month: [ 'ヶ月', 'ヶ月' ], | ||
week: [ '週間', '週間' ], | ||
day: [ '日', '日' ], | ||
hour: [ '時間', '時間' ], | ||
minute: [ '分', '分' ], | ||
jp: { | ||
year: [ '年', '年' ], | ||
month: [ 'ヶ月', 'ヶ月' ], | ||
week: [ '週間', '週間' ], | ||
day: [ '日', '日' ], | ||
hour: [ '時間', '時間' ], | ||
minute: [ '分', '分' ], | ||
past: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '前'; | ||
}, | ||
past: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '前'; | ||
}, | ||
future: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '後'; | ||
}, | ||
future: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '後'; | ||
}, | ||
defaults: { | ||
past: '今', | ||
future: 'すぐに' | ||
} | ||
} | ||
defaults: { | ||
past: '今', | ||
future: 'すぐに' | ||
} | ||
} | ||
}, | ||
@@ -171,2 +172,1 @@ | ||
}(this)); | ||
@@ -170,2 +170,1 @@ /** | ||
}(this)); | ||
@@ -170,2 +170,1 @@ /** | ||
}(this)); | ||
@@ -170,2 +170,1 @@ /** | ||
}(this)); | ||
@@ -149,2 +149,1 @@ /** | ||
}(this)); | ||
@@ -150,2 +150,1 @@ /** | ||
}(this)); | ||
@@ -149,2 +149,1 @@ /** | ||
}(this)); | ||
@@ -21,23 +21,24 @@ /** | ||
languages = { | ||
jp: { | ||
year: [ '年', '年' ], | ||
month: [ 'ヶ月', 'ヶ月' ], | ||
week: [ '週間', '週間' ], | ||
day: [ '日', '日' ], | ||
hour: [ '時間', '時間' ], | ||
minute: [ '分', '分' ], | ||
jp: { | ||
year: [ '年', '年' ], | ||
month: [ 'ヶ月', 'ヶ月' ], | ||
week: [ '週間', '週間' ], | ||
day: [ '日', '日' ], | ||
hour: [ '時間', '時間' ], | ||
minute: [ '分', '分' ], | ||
past: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '前'; | ||
}, | ||
past: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '前'; | ||
}, | ||
future: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '後'; | ||
}, | ||
future: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '後'; | ||
}, | ||
defaults: { | ||
past: '今', | ||
future: 'すぐに' | ||
} | ||
}, | ||
defaults: { | ||
past: '今', | ||
future: 'すぐに' | ||
} | ||
} | ||
, | ||
ko: { | ||
@@ -192,2 +193,1 @@ year: [ '년', '년' ], | ||
}(this)); | ||
@@ -21,23 +21,24 @@ /** | ||
languages = { | ||
jp: { | ||
year: [ '年', '年' ], | ||
month: [ 'ヶ月', 'ヶ月' ], | ||
week: [ '週間', '週間' ], | ||
day: [ '日', '日' ], | ||
hour: [ '時間', '時間' ], | ||
minute: [ '分', '分' ], | ||
jp: { | ||
year: [ '年', '年' ], | ||
month: [ 'ヶ月', 'ヶ月' ], | ||
week: [ '週間', '週間' ], | ||
day: [ '日', '日' ], | ||
hour: [ '時間', '時間' ], | ||
minute: [ '分', '分' ], | ||
past: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '前'; | ||
}, | ||
past: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '前'; | ||
}, | ||
future: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '後'; | ||
}, | ||
future: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '後'; | ||
}, | ||
defaults: { | ||
past: '今', | ||
future: 'すぐに' | ||
} | ||
} | ||
defaults: { | ||
past: '今', | ||
future: 'すぐに' | ||
} | ||
} | ||
}, | ||
@@ -150,2 +151,1 @@ | ||
}(this)); | ||
@@ -149,2 +149,1 @@ /** | ||
}(this)); | ||
@@ -149,2 +149,1 @@ /** | ||
}(this)); | ||
@@ -149,2 +149,1 @@ /** | ||
}(this)); | ||
@@ -149,23 +149,55 @@ /** | ||
}, | ||
jp: { | ||
year: [ '年', '年' ], | ||
month: [ 'ヶ月', 'ヶ月' ], | ||
week: [ '週間', '週間' ], | ||
day: [ '日', '日' ], | ||
hour: [ '時間', '時間' ], | ||
minute: [ '分', '分' ], | ||
hu: { | ||
year: [ 'éve', 'éve' ], | ||
month: [ 'hónapja', 'hónapja' ], | ||
week: [ 'hete', 'hete' ], | ||
day: [ 'napja', 'napja' ], | ||
hour: [ 'órája', 'órája' ], | ||
minute: [ 'perce', 'perce' ], | ||
past: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '前'; | ||
}, | ||
past: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit; | ||
}, | ||
future: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '後'; | ||
}, | ||
future: function (vagueTime, unit) { | ||
var transform = { | ||
'éve': 'év', | ||
'hónapja': 'hónap', | ||
'hete': 'hét', | ||
'napja': 'nap', | ||
'órája': 'óra', | ||
'perce': 'perc' | ||
}; | ||
unit = transform[unit]; | ||
return vagueTime + ' ' + unit + ' múlva'; | ||
}, | ||
defaults: { | ||
past: '今', | ||
future: 'すぐに' | ||
} | ||
}, | ||
defaults: { | ||
past: 'most', | ||
future: 'hamarosan' | ||
} | ||
} | ||
, | ||
jp: { | ||
year: [ '年', '年' ], | ||
month: [ 'ヶ月', 'ヶ月' ], | ||
week: [ '週間', '週間' ], | ||
day: [ '日', '日' ], | ||
hour: [ '時間', '時間' ], | ||
minute: [ '分', '分' ], | ||
past: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '前'; | ||
}, | ||
future: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '後'; | ||
}, | ||
defaults: { | ||
past: '今', | ||
future: 'すぐに' | ||
} | ||
} | ||
, | ||
ko: { | ||
@@ -213,2 +245,23 @@ year: [ '년', '년' ], | ||
}, | ||
se: { | ||
year: [ 'år', 'år' ], | ||
month: [ 'månad', 'månader' ], | ||
week: [ 'vecka', 'veckor' ], | ||
day: [ 'dag', 'dagar' ], | ||
hour: [ 'timme', 'timmar' ], | ||
minute: [ 'minut', 'minuter' ], | ||
past: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + ' sedan'; | ||
}, | ||
future: function (vagueTime, unit) { | ||
return 'om ' + vagueTime + ' ' + unit; | ||
}, | ||
defaults: { | ||
past: 'alldeles nyss', | ||
future: 'alldeles strax' | ||
} | ||
}, | ||
zh: { | ||
@@ -342,2 +395,1 @@ year: [ '年', '年' ], | ||
}(this)); | ||
@@ -1,1 +0,1 @@ | ||
!function(e){"use strict";function t(e){var t,r=n(e.units),a=Date.now(),i=u(e.from,r,a),s=u(e.to,r,a),f=i-s;return f>=0?t="past":(t="future",f=-f),o(f,t,e.lang)}function n(e){if("undefined"==typeof e)return"ms";if("s"===e||"ms"===e)return e;throw new Error("Invalid units")}function u(e,t,n){if("undefined"==typeof e)return n;if("string"==typeof e&&(e=parseInt(e,10)),r(e)&&a(e))throw new Error("Invalid time");return"number"==typeof e&&"s"===t&&(e*=1e3),e}function r(e){return"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime())}function a(e){return"number"!=typeof e||isNaN(e)}function o(e,t,n){var u,r,a=f[n]||f[m];for(u in s)if(s.hasOwnProperty(u)&&e>=s[u])return r=Math.floor(e/s[u]),a[t](r,a[u][(r>1)+0]);return a.defaults[t]}function i(){"function"==typeof define&&define.amd?define("vagueTime",["exports"],function(e){e.get=d.get}):"undefined"!=typeof module&&null!==module?module.exports=d:e.vagueTime=d}var s={year:315576e5,month:26298e5,week:6048e5,day:864e5,hour:36e5,minute:6e4},f={br:{year:["ano","anos"],month:["mês","meses"],week:["semana","semanas"],day:["dia","dias"],hour:["hora","horas"],minute:["minuto","minutos"],past:function(e,t){return e+" "+t+" atrás"},future:function(e,t){return"em "+e+" "+t},defaults:{past:"agora mesmo",future:"em breve"}},da:{year:["år","år"],month:["måned","måneder"],week:["uge","uger"],day:["dag","dage"],hour:["time","timer"],minute:["minut","minutter"],past:function(e,t){return e+" "+t+" siden"},future:function(e,t){return"om "+e+" "+t},defaults:{past:"lige nu",future:"snart"}},de:{year:["Jahr","Jahren"],month:["Monat","Monaten"],week:["Woche","Wochen"],day:["Tag","Tagen"],hour:["Stunde","Stunden"],minute:["Minute","Minuten"],past:function(e,t){return"vor "+e+" "+t},future:function(e,t){return"in "+e+" "+t},defaults:{past:"jetzt gerade",future:"bald"}},en:{year:["year","years"],month:["month","months"],week:["week","weeks"],day:["day","days"],hour:["hour","hours"],minute:["minute","minutes"],past:function(e,t){return e+" "+t+" ago"},future:function(e,t){return"in "+e+" "+t},defaults:{past:"just now",future:"soon"}},es:{year:["año","años"],month:["mes","meses"],week:["semana","semanas"],day:["día","días"],hour:["hora","horas"],minute:["minuto","minutos"],past:function(e,t){return"hace "+e+" "+t},future:function(e,t){return"en "+e+" "+t},defaults:{past:"recién",future:"dentro de poco"}},fr:{year:["an","ans"],month:["mois","mois"],week:["semaine","semaines"],day:["jour","jours"],hour:["heure","heures"],minute:["minute","minutes"],past:function(e,t){return"il y a "+e+" "+t},future:function(e,t){return"dans "+e+" "+t},defaults:{past:"tout de suite",future:"bientôt"}},jp:{year:["年","年"],month:["ヶ月","ヶ月"],week:["週間","週間"],day:["日","日"],hour:["時間","時間"],minute:["分","分"],past:function(e,t){return e+" "+t+"前"},future:function(e,t){return e+" "+t+"後"},defaults:{past:"今",future:"すぐに"}},ko:{year:["년","년"],month:["개월","개월"],week:["주","주"],day:["일","일"],hour:["시간","시간"],minute:["분","분"],past:function(e,t){return e+" "+t+" 전"},future:function(e,t){return e+" "+t+" 후"},defaults:{past:"지금",future:"곧"}},nl:{year:["jaar","jaar"],month:["maand","maanden"],week:["week","weken"],day:["dag","dagen"],hour:["uur","uur"],minute:["minuut","minuten"],past:function(e,t){return e+" "+t+" geleden"},future:function(e,t){return"over "+e+" "+t},defaults:{past:"juist nu",future:"binnenkort"}},zh:{year:["年","年"],month:["个月","个月"],week:["周","周"],day:["天","天"],hour:["小时","小时"],minute:["分钟","分钟"],past:function(e,t){return e+" "+t+" 之前"},future:function(e,t){return"in "+e+" "+t},defaults:{past:"刚刚",future:"马上"}}},m="en",d={get:t};i()}(this); | ||
!function(e){"use strict";function t(e){var t,r=n(e.units),a=Date.now(),i=u(e.from,r,a),s=u(e.to,r,a),f=i-s;return f>=0?t="past":(t="future",f=-f),o(f,t,e.lang)}function n(e){if("undefined"==typeof e)return"ms";if("s"===e||"ms"===e)return e;throw new Error("Invalid units")}function u(e,t,n){if("undefined"==typeof e)return n;if("string"==typeof e&&(e=parseInt(e,10)),r(e)&&a(e))throw new Error("Invalid time");return"number"==typeof e&&"s"===t&&(e*=1e3),e}function r(e){return"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime())}function a(e){return"number"!=typeof e||isNaN(e)}function o(e,t,n){var u,r,a=f[n]||f[m];for(u in s)if(s.hasOwnProperty(u)&&e>=s[u])return r=Math.floor(e/s[u]),a[t](r,a[u][(r>1)+0]);return a.defaults[t]}function i(){"function"==typeof define&&define.amd?define("vagueTime",["exports"],function(e){e.get=d.get}):"undefined"!=typeof module&&null!==module?module.exports=d:e.vagueTime=d}var s={year:315576e5,month:26298e5,week:6048e5,day:864e5,hour:36e5,minute:6e4},f={br:{year:["ano","anos"],month:["mês","meses"],week:["semana","semanas"],day:["dia","dias"],hour:["hora","horas"],minute:["minuto","minutos"],past:function(e,t){return e+" "+t+" atrás"},future:function(e,t){return"em "+e+" "+t},defaults:{past:"agora mesmo",future:"em breve"}},da:{year:["år","år"],month:["måned","måneder"],week:["uge","uger"],day:["dag","dage"],hour:["time","timer"],minute:["minut","minutter"],past:function(e,t){return e+" "+t+" siden"},future:function(e,t){return"om "+e+" "+t},defaults:{past:"lige nu",future:"snart"}},de:{year:["Jahr","Jahren"],month:["Monat","Monaten"],week:["Woche","Wochen"],day:["Tag","Tagen"],hour:["Stunde","Stunden"],minute:["Minute","Minuten"],past:function(e,t){return"vor "+e+" "+t},future:function(e,t){return"in "+e+" "+t},defaults:{past:"jetzt gerade",future:"bald"}},en:{year:["year","years"],month:["month","months"],week:["week","weeks"],day:["day","days"],hour:["hour","hours"],minute:["minute","minutes"],past:function(e,t){return e+" "+t+" ago"},future:function(e,t){return"in "+e+" "+t},defaults:{past:"just now",future:"soon"}},es:{year:["año","años"],month:["mes","meses"],week:["semana","semanas"],day:["día","días"],hour:["hora","horas"],minute:["minuto","minutos"],past:function(e,t){return"hace "+e+" "+t},future:function(e,t){return"en "+e+" "+t},defaults:{past:"recién",future:"dentro de poco"}},fr:{year:["an","ans"],month:["mois","mois"],week:["semaine","semaines"],day:["jour","jours"],hour:["heure","heures"],minute:["minute","minutes"],past:function(e,t){return"il y a "+e+" "+t},future:function(e,t){return"dans "+e+" "+t},defaults:{past:"tout de suite",future:"bientôt"}},hu:{year:["éve","éve"],month:["hónapja","hónapja"],week:["hete","hete"],day:["napja","napja"],hour:["órája","órája"],minute:["perce","perce"],past:function(e,t){return e+" "+t},future:function(e,t){var n={"éve":"év","hónapja":"hónap",hete:"hét",napja:"nap","órája":"óra",perce:"perc"};return t=n[t],e+" "+t+" múlva"},defaults:{past:"most",future:"hamarosan"}},jp:{year:["年","年"],month:["ヶ月","ヶ月"],week:["週間","週間"],day:["日","日"],hour:["時間","時間"],minute:["分","分"],past:function(e,t){return e+" "+t+"前"},future:function(e,t){return e+" "+t+"後"},defaults:{past:"今",future:"すぐに"}},ko:{year:["년","년"],month:["개월","개월"],week:["주","주"],day:["일","일"],hour:["시간","시간"],minute:["분","분"],past:function(e,t){return e+" "+t+" 전"},future:function(e,t){return e+" "+t+" 후"},defaults:{past:"지금",future:"곧"}},nl:{year:["jaar","jaar"],month:["maand","maanden"],week:["week","weken"],day:["dag","dagen"],hour:["uur","uur"],minute:["minuut","minuten"],past:function(e,t){return e+" "+t+" geleden"},future:function(e,t){return"over "+e+" "+t},defaults:{past:"juist nu",future:"binnenkort"}},se:{year:["år","år"],month:["månad","månader"],week:["vecka","veckor"],day:["dag","dagar"],hour:["timme","timmar"],minute:["minut","minuter"],past:function(e,t){return e+" "+t+" sedan"},future:function(e,t){return"om "+e+" "+t},defaults:{past:"alldeles nyss",future:"alldeles strax"}},zh:{year:["年","年"],month:["个月","个月"],week:["周","周"],day:["天","天"],hour:["小时","小时"],minute:["分钟","分钟"],past:function(e,t){return e+" "+t+" 之前"},future:function(e,t){return"in "+e+" "+t},defaults:{past:"刚刚",future:"马上"}}},m="en",d={get:t};i()}(this); |
{ | ||
"name": "vague-time", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "A tiny library that formats precise time differences as a vague/fuzzy time. Supports 10 languages.", | ||
@@ -31,3 +31,3 @@ "homepage": "https://github.com/philbooth/vagueTime.js", | ||
"build": "npm run build-singles && npm run build-doubles && npm run build-trebles && npm run build-all", | ||
"build-singles": "npm run build-br && npm run build-da && npm run build-de && npm run build-en && npm run build-es && npm run build-fr && npm run build-nl && npm run build-jp && npm run build-ko && npm run build-zh", | ||
"build-singles": "npm run build-br && npm run build-da && npm run build-de && npm run build-en && npm run build-es && npm run build-fr && npm run build-hu && npm run build-jp && npm run build-ko && npm run build-nl && npm run build-se && npm run build-zh", | ||
"build-br": "./build.js -l br", | ||
@@ -39,7 +39,9 @@ "build-da": "./build.js -l da", | ||
"build-fr": "./build.js -l fr", | ||
"build-nl": "./build.js -l nl", | ||
"build-hu": "./build.js -l hu", | ||
"build-jp": "./build.js -l jp", | ||
"build-ko": "./build.js -l ko", | ||
"build-nl": "./build.js -l nl", | ||
"build-se": "./build.js -l se", | ||
"build-zh": "./build.js -l zh", | ||
"build-doubles": "npm run build-enbr && npm run build-enda && npm run build-ende && npm run build-enes && npm run build-enfr && npm run build-ennl && npm run build-enjp && npm run build-enko && npm run build-enzh", | ||
"build-doubles": "npm run build-enbr && npm run build-enda && npm run build-ende && npm run build-enes && npm run build-enfr && npm run build-enhu && npm run build-enjp && npm run build-enko && npm run build-ennl && npm run build-ense && npm run build-enzh", | ||
"build-enbr": "./build.js -l en,br", | ||
@@ -50,5 +52,7 @@ "build-enda": "./build.js -l en,da", | ||
"build-enfr": "./build.js -l en,fr", | ||
"build-ennl": "./build.js -l en,nl", | ||
"build-enhu": "./build.js -l en,hu", | ||
"build-enjp": "./build.js -l en,jp", | ||
"build-enko": "./build.js -l en,ko", | ||
"build-ennl": "./build.js -l en,nl", | ||
"build-ense": "./build.js -l en,se", | ||
"build-enzh": "./build.js -l en,zh", | ||
@@ -55,0 +59,0 @@ "build-trebles": "npm run build-jpkozh", |
@@ -6,3 +6,3 @@ # vagueTime.js | ||
as a vague/fuzzy time. | ||
Supports 10 different languages. | ||
Supports 12 different languages. | ||
@@ -43,5 +43,7 @@ [![Build status][ci-image]][ci-status] | ||
German, | ||
Hungarian, | ||
Japanese, | ||
Korean or | ||
Spanish. | ||
Korean, | ||
Spanish or | ||
Swedish. | ||
@@ -67,6 +69,6 @@ ## What alternative libraries are there? | ||
The largest build, | ||
containing all 10 supported languages, | ||
is 8.7 kb unminified with comments, | ||
3.4 kb minified or | ||
1.4 kb minified+gzipped. | ||
containing all 12 supported languages, | ||
is 11 kb unminified with comments, | ||
4.3 kb minified or | ||
1.6 kb minified+gzipped. | ||
@@ -126,3 +128,3 @@ ## How do I install it? | ||
that the default module | ||
contains all 10 | ||
contains all 12 | ||
supported languages. | ||
@@ -134,3 +136,3 @@ If you want | ||
that you reference | ||
that correct explicitly. | ||
it explicitly. | ||
@@ -137,0 +139,0 @@ ### Calling the exported functions |
@@ -1,21 +0,21 @@ | ||
jp: { | ||
year: [ '年', '年' ], | ||
month: [ 'ヶ月', 'ヶ月' ], | ||
week: [ '週間', '週間' ], | ||
day: [ '日', '日' ], | ||
hour: [ '時間', '時間' ], | ||
minute: [ '分', '分' ], | ||
jp: { | ||
year: [ '年', '年' ], | ||
month: [ 'ヶ月', 'ヶ月' ], | ||
week: [ '週間', '週間' ], | ||
day: [ '日', '日' ], | ||
hour: [ '時間', '時間' ], | ||
minute: [ '分', '分' ], | ||
past: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '前'; | ||
}, | ||
past: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '前'; | ||
}, | ||
future: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '後'; | ||
}, | ||
future: function (vagueTime, unit) { | ||
return vagueTime + ' ' + unit + '後'; | ||
}, | ||
defaults: { | ||
past: '今', | ||
future: 'すぐに' | ||
} | ||
} | ||
defaults: { | ||
past: '今', | ||
future: 'すぐに' | ||
} | ||
} |
@@ -129,2 +129,1 @@ /** | ||
}(this)); | ||
@@ -608,5 +608,67 @@ /*globals require, chai */ | ||
}); | ||
test('get returns alldeles nyss when time is 1 second ago (swedish)', function () { | ||
assert.strictEqual(vagueTime.get({ | ||
from: 1234567890, | ||
to: 1234567889, | ||
units: 's', | ||
lang: 'se' | ||
}), 'alldeles nyss'); | ||
}); | ||
test('get returns 1 minut sedan when time is 60,000 milliseconds ago (swedish)', function () { | ||
assert.strictEqual(vagueTime.get({ | ||
from: 1234567890000, | ||
to: 1234567830000, | ||
units: 'ms', | ||
lang: 'se' | ||
}), '1 minut sedan'); | ||
}); | ||
test('get returns alldeles strax when time is 59 seconds ahead (swedish)', function () { | ||
assert.strictEqual(vagueTime.get({ | ||
from: 1234567890, | ||
to: 1234567949, | ||
units: 's', | ||
lang: 'se' | ||
}), 'alldeles strax'); | ||
}); | ||
test('get returns 1 év múlva when time is 31,557,600 seconds ahead (hungarian)', function () { | ||
assert.strictEqual(vagueTime.get({ | ||
from: 1234567890, | ||
to: 1266125490, | ||
units: 's', | ||
lang: 'hu' | ||
}), '1 év múlva'); | ||
}); | ||
test('get returns 1 hete when time is 604,800 seconds ago (hungarian)', function () { | ||
assert.strictEqual(vagueTime.get({ | ||
from: 1234567890, | ||
to: 1233963090, | ||
units: 's', | ||
lang: 'hu' | ||
}), '1 hete'); | ||
}); | ||
test('get returns hamarosan when time is 1 second in the future (hungarian)', function () { | ||
assert.strictEqual(vagueTime.get({ | ||
from: 0, | ||
to: 1, | ||
units: 's', | ||
lang: 'hu' | ||
}), 'hamarosan'); | ||
}); | ||
test('get returns 2 nap múlva when time is 172800 second in the future (hungarian)', function () { | ||
assert.strictEqual(vagueTime.get({ | ||
from: 0, | ||
to: 172800, | ||
units: 's', | ||
lang: 'hu' | ||
}), '2 nap múlva'); | ||
}); | ||
}); | ||
}); | ||
}(typeof require === 'function' ? require : undefined)); | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
181415
51
4530
274