function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
- 's': ['thodde secondanim', 'thodde second'],
- 'ss': [number + ' secondanim', number + ' second'],
- 'm': ['eka mintan', 'ek minute'],
- 'mm': [number + ' mintanim', number + ' mintam'],
+ 's': ['thoddea sekondamni', 'thodde sekond'],
+ 'ss': [number + ' sekondamni', number + ' sekond'],
+ 'm': ['eka mintan', 'ek minut'],
+ 'mm': [number + ' mintamni', number + ' mintam'],
'h': ['eka voran', 'ek vor'],
- 'hh': [number + ' voranim', number + ' voram'],
+ 'hh': [number + ' voramni', number + ' voram'],
'd': ['eka disan', 'ek dis'],
- 'dd': [number + ' disanim', number + ' dis'],
+ 'dd': [number + ' disamni', number + ' dis'],
'M': ['eka mhoinean', 'ek mhoino'],
- 'MM': [number + ' mhoineanim', number + ' mhoine'],
+ 'MM': [number + ' mhoineamni', number + ' mhoine'],
'y': ['eka vorsan', 'ek voros'],
- 'yy': [number + ' vorsanim', number + ' vorsam']
+ 'yy': [number + ' vorsamni', number + ' vorsam']
};
- return withoutSuffix ? format[key][0] : format[key][1];
+ return isFuture ? format[key][0] : format[key][1];
}
export default moment.defineLocale('gom-latn', {
- months : 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split('_'),
+ months : {
+ standalone: 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split('_'),
+ format: 'Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea'.split('_'),
+ isFormat: /MMMM(\s)+D[oD]?/
+ },
monthsShort : 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split('_'),
monthsParseExact : true,
- weekdays : 'Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son\'var'.split('_'),
+ weekdays : 'Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son\'var'.split('_'),
weekdaysShort : 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),
weekdaysMin : 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),
weekdaysParseExact : true,
L : 'DD-MM-YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY A h:mm [vazta]',
- LLLL : 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]',
+ LLLL : 'dddd, MMMM Do, YYYY, A h:mm [vazta]',
llll: 'ddd, D MMM YYYY, A h:mm [vazta]'
},
calendar : {
sameDay: '[Aiz] LT',
nextDay: '[Faleam] LT',
- nextWeek: '[Ieta to] dddd[,] LT',
+ nextWeek: '[Fuddlo] dddd[,] LT',
lastDay: '[Kal] LT',
- lastWeek: '[Fatlo] dddd[,] LT',
+ lastWeek: '[Fattlo] dddd[,] LT',
sameElse: 'L'
},
relativeTime : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
},
- meridiemParse: /rati|sokalli|donparam|sanje/,
+ meridiemParse: /rati|sokallim|donparam|sanje/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'rati') {
return hour < 4 ? hour : hour + 12;
- } else if (meridiem === 'sokalli') {
+ } else if (meridiem === 'sokallim') {
return hour;
} else if (meridiem === 'donparam') {
return hour > 12 ? hour : hour + 12;
if (hour < 4) {
return 'rati';
} else if (hour < 12) {
- return 'sokalli';
+ return 'sokallim';
} else if (hour < 16) {
return 'donparam';
} else if (hour < 20) {
test('format', function (assert) {
var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Aitar, Febrer 14er 2010, 3:25:50 donparam'],
- ['ddd, hA', 'Ait., 3donparam'],
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Aitar, Febrerachea 14er 2010, 3:25:50 donparam'],
+ ['ddd, h A', 'Ait., 3 donparam'],
['M Mo MM MMMM MMM', '2 2 02 Febrer Feb.'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14er 14'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'donparam donparam'],
- ['[the] DDDo [day of the year]', 'the 45 day of the year'],
+ ['[Vorsacho] DDDo[vo dis]', 'Vorsacho 45vo dis'],
['LTS', 'donparam 3:25:50 vazta'],
['L', '14-02-2010'],
['LL', '14 Febrer 2010'],
test('format week', function (assert) {
var i,
- expected = 'Aitar Ait. Ai_Somar Som. Sm_Mongllar Mon. Mo_Budvar Bud. Bu_Brestar Bre. Br_Sukrar Suk. Su_Son\'var Son. Sn'.split('_');
+ expected = 'Aitar Ait. Ai_Somar Som. Sm_Mongllar Mon. Mo_Budhvar Bud. Bu_Birestar Bre. Br_Sukrar Suk. Su_Son\'var Son. Sn'.split('_');
for (i = 0; i < expected.length; i++) {
assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
test('from', function (assert) {
var start = moment([2007, 1, 28]);
- assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'thodde secondanim', '44 seconds = a few seconds');
- assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'eka mintan', '45 seconds = a minute');
- assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'eka mintan', '89 seconds = a minute');
- assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 mintanim', '90 seconds = 2 minutes');
- assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 mintanim', '44 minutes = 44 minutes');
- assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'eka voran', '45 minutes = an hour');
- assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'eka voran', '89 minutes = an hour');
- assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 voranim', '90 minutes = 2 hours');
- assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 voranim', '5 hours = 5 hours');
- assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 voranim', '21 hours = 21 hours');
- assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'eka disan', '22 hours = a day');
- assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'eka disan', '35 hours = a day');
- assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 disanim', '36 hours = 2 days');
- assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'eka disan', '1 day = a day');
- assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 disanim', '5 days = 5 days');
- assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 disanim', '25 days = 25 days');
- assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'eka mhoinean', '26 days = a month');
- assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'eka mhoinean', '30 days = a month');
- assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'eka mhoinean', '43 days = a month');
- assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mhoineanim', '46 days = 2 months');
- assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mhoineanim', '75 days = 2 months');
- assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mhoineanim', '76 days = 3 months');
- assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'eka mhoinean', '1 month = a month');
- assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mhoineanim', '5 months = 5 months');
- assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'eka vorsan', '345 days = a year');
- assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 vorsanim', '548 days = 2 years');
- assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'eka vorsan', '1 year = a year');
- assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 vorsanim', '5 years = 5 years');
+ assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'thodde sekond', '44 seconds = a few seconds');
+ assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ek minut', '45 seconds = a minute');
+ assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'ek minut', '89 seconds = a minute');
+ assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 mintam', '90 seconds = 2 minutes');
+ assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 mintam', '44 minutes = 44 minutes');
+ assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ek vor', '45 minutes = an hour');
+ assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ek vor', '89 minutes = an hour');
+ assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 voram', '90 minutes = 2 hours');
+ assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 voram', '5 hours = 5 hours');
+ assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 voram', '21 hours = 21 hours');
+ assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ek dis', '22 hours = a day');
+ assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ek dis', '35 hours = a day');
+ assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 dis', '36 hours = 2 days');
+ assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ek dis', '1 day = a day');
+ assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 dis', '5 days = 5 days');
+ assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 dis', '25 days = 25 days');
+ assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ek mhoino', '26 days = a month');
+ assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ek mhoino', '30 days = a month');
+ assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ek mhoino', '43 days = a month');
+ assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 mhoine', '46 days = 2 months');
+ assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 mhoine', '75 days = 2 months');
+ assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 mhoine', '76 days = 3 months');
+ assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ek mhoino', '1 month = a month');
+ assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 mhoine', '5 months = 5 months');
+ assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ek voros', '345 days = a year');
+ assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 vorsam', '548 days = 2 years');
+ assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ek voros', '1 year = a year');
+ assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 vorsam', '5 years = 5 years');
});
test('suffix', function (assert) {
- assert.equal(moment(30000).from(0), 'thodde second', 'prefix');
- assert.equal(moment(0).from(30000), 'thodde second adim', 'suffix');
+ assert.equal(moment(30000).from(0), 'thoddea sekondamni', 'prefix');
+ assert.equal(moment(0).from(30000), 'thodde sekond adim', 'suffix');
});
test('now from now', function (assert) {
- assert.equal(moment().fromNow(), 'thodde second adim', 'now from now should display as in the past');
+ assert.equal(moment().fromNow(), 'thodde sekond adim', 'now from now should display as in the past');
});
test('fromNow', function (assert) {
- assert.equal(moment().add({s: 30}).fromNow(), 'thodde second', 'in a few seconds');
- assert.equal(moment().add({d: 5}).fromNow(), '5 dis', 'in 5 days');
+ assert.equal(moment().add({s: 30}).fromNow(), 'thoddea sekondamni', 'in a few seconds');
+ assert.equal(moment().add({d: 5}).fromNow(), '5 disamni', 'in 5 days');
});
test('ago', function (assert) {
assert.equal(moment(a).add({m: 25}).calendar(), 'Aiz donparam 12:25 vazta', 'Now plus 25 min');
assert.equal(moment(a).add({h: 1}).calendar(), 'Aiz donparam 1:00 vazta', 'Now plus 1 hour');
assert.equal(moment(a).add({d: 1}).calendar(), 'Faleam donparam 12:00 vazta', 'tomorrow at the same time');
- assert.equal(moment(a).subtract({h: 1}).calendar(), 'Aiz sokalli 11:00 vazta', 'Now minus 1 hour');
+ assert.equal(moment(a).subtract({h: 1}).calendar(), 'Aiz sokallim 11:00 vazta', 'Now minus 1 hour');
assert.equal(moment(a).subtract({d: 1}).calendar(), 'Kal donparam 12:00 vazta', 'yesterday at the same time');
});
for (i = 2; i < 7; i++) {
m = moment().add({d: i});
- assert.equal(m.calendar(), m.format('[Ieta to] dddd[,] LT'), 'Today + ' + i + ' days current time');
+ assert.equal(m.calendar(), m.format('[Fuddlo] dddd[,] LT'), 'Today + ' + i + ' days current time');
m.hours(0).minutes(0).seconds(0).milliseconds(0);
- assert.equal(m.calendar(), m.format('[Ieta to] dddd[,] LT'), 'Today + ' + i + ' days beginning of day');
+ assert.equal(m.calendar(), m.format('[Fuddlo] dddd[,] LT'), 'Today + ' + i + ' days beginning of day');
m.hours(23).minutes(59).seconds(59).milliseconds(999);
- assert.equal(m.calendar(), m.format('[Ieta to] dddd[,] LT'), 'Today + ' + i + ' days end of day');
+ assert.equal(m.calendar(), m.format('[Fuddlo] dddd[,] LT'), 'Today + ' + i + ' days end of day');
}
});
for (i = 2; i < 7; i++) {
m = moment().subtract({d: i});
- assert.equal(m.calendar(), m.format('[Fatlo] dddd[,] LT'), 'Today - ' + i + ' days current time');
+ assert.equal(m.calendar(), m.format('[Fattlo] dddd[,] LT'), 'Today - ' + i + ' days current time');
m.hours(0).minutes(0).seconds(0).milliseconds(0);
- assert.equal(m.calendar(), m.format('[Fatlo] dddd[,] LT'), 'Today - ' + i + ' days beginning of day');
+ assert.equal(m.calendar(), m.format('[Fattlo] dddd[,] LT'), 'Today - ' + i + ' days beginning of day');
m.hours(23).minutes(59).seconds(59).milliseconds(999);
- assert.equal(m.calendar(), m.format('[Fatlo] dddd[,] LT'), 'Today - ' + i + ' days end of day');
+ assert.equal(m.calendar(), m.format('[Fattlo] dddd[,] LT'), 'Today - ' + i + ' days end of day');
}
});