ledgerrb/public/app/bower_components/moment/locale/lt.js

119 lines
4.1 KiB
JavaScript
Raw Normal View History

2014-09-30 12:29:53 +02:00
// moment.js locale configuration
// locale : Lithuanian (lt)
2014-07-31 18:00:20 +02:00
// author : Mindaugas Mozūras : https://github.com/mmozuras
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory(window.moment); // Browser global
}
}(function (moment) {
var units = {
2014-09-30 12:29:53 +02:00
'm' : 'minutė_minutės_minutę',
'mm': 'minutės_minučių_minutes',
'h' : 'valanda_valandos_valandą',
'hh': 'valandos_valandų_valandas',
'd' : 'diena_dienos_dieną',
'dd': 'dienos_dienų_dienas',
'M' : 'mėnuo_mėnesio_mėnesį',
'MM': 'mėnesiai_mėnesių_mėnesius',
'y' : 'metai_metų_metus',
'yy': 'metai_metų_metus'
2014-07-31 18:00:20 +02:00
},
2014-09-30 12:29:53 +02:00
weekDays = 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_');
2014-07-31 18:00:20 +02:00
function translateSeconds(number, withoutSuffix, key, isFuture) {
if (withoutSuffix) {
2014-09-30 12:29:53 +02:00
return 'kelios sekundės';
2014-07-31 18:00:20 +02:00
} else {
2014-09-30 12:29:53 +02:00
return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
2014-07-31 18:00:20 +02:00
}
}
function translateSingular(number, withoutSuffix, key, isFuture) {
return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);
}
function special(number) {
return number % 10 === 0 || (number > 10 && number < 20);
}
function forms(key) {
2014-09-30 12:29:53 +02:00
return units[key].split('_');
2014-07-31 18:00:20 +02:00
}
function translate(number, withoutSuffix, key, isFuture) {
2014-09-30 12:29:53 +02:00
var result = number + ' ';
2014-07-31 18:00:20 +02:00
if (number === 1) {
return result + translateSingular(number, withoutSuffix, key[0], isFuture);
} else if (withoutSuffix) {
return result + (special(number) ? forms(key)[1] : forms(key)[0]);
} else {
if (isFuture) {
return result + forms(key)[1];
} else {
return result + (special(number) ? forms(key)[1] : forms(key)[2]);
}
}
}
function relativeWeekDay(moment, format) {
var nominative = format.indexOf('dddd HH:mm') === -1,
weekDay = weekDays[moment.day()];
2014-09-30 12:29:53 +02:00
return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + 'į';
2014-07-31 18:00:20 +02:00
}
2014-09-30 12:29:53 +02:00
return moment.defineLocale('lt', {
months : 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),
monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
2014-07-31 18:00:20 +02:00
weekdays : relativeWeekDay,
2014-09-30 12:29:53 +02:00
weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),
2014-07-31 18:00:20 +02:00
longDateFormat : {
2014-09-30 12:29:53 +02:00
LT : 'HH:mm',
L : 'YYYY-MM-DD',
LL : 'YYYY [m.] MMMM D [d.]',
LLL : 'YYYY [m.] MMMM D [d.], LT [val.]',
LLLL : 'YYYY [m.] MMMM D [d.], dddd, LT [val.]',
l : 'YYYY-MM-DD',
ll : 'YYYY [m.] MMMM D [d.]',
lll : 'YYYY [m.] MMMM D [d.], LT [val.]',
llll : 'YYYY [m.] MMMM D [d.], ddd, LT [val.]'
2014-07-31 18:00:20 +02:00
},
calendar : {
2014-09-30 12:29:53 +02:00
sameDay : '[Šiandien] LT',
nextDay : '[Rytoj] LT',
nextWeek : 'dddd LT',
lastDay : '[Vakar] LT',
lastWeek : '[Praėjusį] dddd LT',
sameElse : 'L'
2014-07-31 18:00:20 +02:00
},
relativeTime : {
2014-09-30 12:29:53 +02:00
future : 'po %s',
past : 'prieš %s',
2014-07-31 18:00:20 +02:00
s : translateSeconds,
m : translateSingular,
mm : translate,
h : translateSingular,
hh : translate,
d : translateSingular,
dd : translate,
M : translateSingular,
MM : translate,
y : translateSingular,
yy : translate
},
ordinal : function (number) {
return number + '-oji';
},
week : {
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.
}
});
}));