momentjs-rails 1.5.0 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,72 @@
1
+ (function () {
2
+ var plural = function (n) {
3
+ return (n % 10 < 5) && (n % 10 > 1) && (~~(n / 10) !== 1);
4
+ },
5
+
6
+ translate = function (number, withoutSuffix, key) {
7
+ var result = number + " ";
8
+ switch (key) {
9
+ case 'm':
10
+ return withoutSuffix ? 'minuta' : 'minutę';
11
+ case 'mm':
12
+ return result + (plural(number) ? 'minuty' : 'minut');
13
+ case 'h':
14
+ return withoutSuffix ? 'godzina' : 'godzinę';
15
+ case 'hh':
16
+ return result + (plural(number) ? 'godziny' : 'godzin');
17
+ case 'MM':
18
+ return result + (plural(number) ? 'miesiące' : 'miesięcy');
19
+ case 'yy':
20
+ return result + (plural(number) ? 'lata' : 'lat');
21
+ }
22
+ },
23
+
24
+ lang = {
25
+ months : "styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),
26
+ monthsShort : "sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),
27
+ weekdays : "niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),
28
+ weekdaysShort : "nie_pon_wt_śr_czw_pt_sb".split("_"),
29
+ longDateFormat : {
30
+ LT : "HH:mm",
31
+ L : "DD-MM-YYYY",
32
+ LL : "D MMMM YYYY",
33
+ LLL : "D MMMM YYYY LT",
34
+ LLLL : "dddd, D MMMM YYYY LT"
35
+ },
36
+ calendar : {
37
+ sameDay: '[Dziś o] LT',
38
+ nextDay: '[Jutro o] LT',
39
+ nextWeek: '[W] dddd [o] LT',
40
+ lastDay: '[Wczoraj o] LT',
41
+ lastWeek: '[W zeszły/łą] dddd [o] LT',
42
+ sameElse: 'L'
43
+ },
44
+ relativeTime : {
45
+ future : "za %s",
46
+ past : "%s temu",
47
+ s : "kilka sekund",
48
+ m : translate,
49
+ mm : translate,
50
+ h : translate,
51
+ hh : translate,
52
+ d : "1 dzień",
53
+ dd : '%d dni',
54
+ M : "miesiąc",
55
+ MM : translate,
56
+ y : "rok",
57
+ yy : translate
58
+ },
59
+ ordinal : function (number) {
60
+ return '.';
61
+ }
62
+ };
63
+
64
+ // Node
65
+ if (typeof module !== 'undefined') {
66
+ module.exports = lang;
67
+ }
68
+ // Browser
69
+ if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
70
+ this.moment.lang('pl', lang);
71
+ }
72
+ }());
@@ -0,0 +1,54 @@
1
+ (function () {
2
+ var lang = {
3
+ months : "Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),
4
+ monthsShort : "Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),
5
+ weekdays : "Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),
6
+ weekdaysShort : "Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),
7
+ longDateFormat : {
8
+ LT : "HH:mm",
9
+ L : "DD/MM/YYYY",
10
+ LL : "D \\de MMMM \\de YYYY",
11
+ LLL : "D \\de MMMM \\de YYYY LT",
12
+ LLLL : "dddd, D \\de MMMM \\de YYYY LT"
13
+ },
14
+ calendar : {
15
+ sameDay: '[Hoje às] LT',
16
+ nextDay: '[Amanhã às] LT',
17
+ nextWeek: 'dddd [às] LT',
18
+ lastDay: '[Ontem às] LT',
19
+ lastWeek: function () {
20
+ return (this.day() === 0 || this.day() === 6) ?
21
+ '[Último] dddd [às] LT' : // Saturday + Sunday
22
+ '[Última] dddd [às] LT'; // Monday - Friday
23
+ },
24
+ sameElse: 'L'
25
+ },
26
+ relativeTime : {
27
+ future : "em %s",
28
+ past : "%s atrás",
29
+ s : "segundos",
30
+ m : "um minuto",
31
+ mm : "%d minutos",
32
+ h : "uma hora",
33
+ hh : "%d horas",
34
+ d : "um dia",
35
+ dd : "%d dias",
36
+ M : "um mês",
37
+ MM : "%d meses",
38
+ y : "um ano",
39
+ yy : "%d anos"
40
+ },
41
+ ordinal : function (number) {
42
+ return 'º';
43
+ }
44
+ };
45
+
46
+ // Node
47
+ if (typeof module !== 'undefined') {
48
+ module.exports = lang;
49
+ }
50
+ // Browser
51
+ if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
52
+ this.moment.lang('pt', lang);
53
+ }
54
+ }());
@@ -0,0 +1,103 @@
1
+ (function () {
2
+
3
+ var pluralRules = [
4
+ function (n) { return ((n % 10 === 1) && (n % 100 !== 11)); },
5
+ function (n) { return ((n % 10) >= 2 && (n % 10) <= 4 && ((n % 10) % 1) === 0) && ((n % 100) < 12 || (n % 100) > 14); },
6
+ function (n) { return ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9 && ((n % 10) % 1) === 0) || ((n % 100) >= 11 && (n % 100) <= 14 && ((n % 100) % 1) === 0)); },
7
+ function (n) { return true; }
8
+ ],
9
+
10
+ plural = function (word, num) {
11
+ var forms = word.split('_'),
12
+ minCount = Math.min(pluralRules.length, forms.length),
13
+ i = -1;
14
+
15
+ while (++i < minCount) {
16
+ if (pluralRules[i](num)) {
17
+ return forms[i];
18
+ }
19
+ }
20
+ return forms[minCount - 1];
21
+ },
22
+
23
+ relativeTimeWithPlural = function (number, withoutSuffix, key) {
24
+ var format = {
25
+ 'mm': 'минута_минуты_минут_минуты',
26
+ 'hh': 'час_часа_часов_часа',
27
+ 'dd': 'день_дня_дней_дня',
28
+ 'MM': 'месяц_месяца_месяцев_месяца',
29
+ 'yy': 'год_года_лет_года'
30
+ };
31
+ if (key === 'm') {
32
+ return withoutSuffix ? 'минута' : 'минуту';
33
+ }
34
+ else {
35
+ return number + ' ' + plural(format[key], +number);
36
+ }
37
+ },
38
+
39
+ lang = {
40
+ months : "январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),
41
+ monthsShort : "янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),
42
+ weekdays : "воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),
43
+ weekdaysShort : "вск_пнд_втр_срд_чтв_птн_суб".split("_"),
44
+ longDateFormat : {
45
+ LT : "HH:mm",
46
+ L : "DD-MM-YYYY",
47
+ LL : "D MMMM YYYY",
48
+ LLL : "D MMMM YYYY LT",
49
+ LLLL : "dddd, D MMMM YYYY LT"
50
+ },
51
+ calendar : {
52
+ sameDay: '[Сегодня в] LT',
53
+ nextDay: '[Завтра в] LT',
54
+ lastDay: '[Вчера в] LT',
55
+ nextWeek: function () {
56
+ return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';
57
+ },
58
+ lastWeek: function () {
59
+ switch (this.day()) {
60
+ case 0:
61
+ return '[В прошлое] dddd [в] LT';
62
+ case 1:
63
+ case 2:
64
+ case 4:
65
+ return '[В прошлый] dddd [в] LT';
66
+ case 3:
67
+ case 5:
68
+ case 6:
69
+ return '[В прошлую] dddd [в] LT';
70
+ }
71
+ },
72
+ sameElse: 'L'
73
+ },
74
+ // It needs checking (adding) russian plurals and cases.
75
+ relativeTime : {
76
+ future : "через %s",
77
+ past : "%s назад",
78
+ s : "несколько секунд",
79
+ m : relativeTimeWithPlural,
80
+ mm : relativeTimeWithPlural,
81
+ h : "час",
82
+ hh : relativeTimeWithPlural,
83
+ d : "день",
84
+ dd : relativeTimeWithPlural,
85
+ M : "месяц",
86
+ MM : relativeTimeWithPlural,
87
+ y : "год",
88
+ yy : relativeTimeWithPlural
89
+ },
90
+ ordinal : function (number) {
91
+ return '.';
92
+ }
93
+ };
94
+
95
+ // Node
96
+ if (typeof module !== 'undefined') {
97
+ module.exports = lang;
98
+ }
99
+ // Browser
100
+ if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
101
+ this.moment.lang('ru', lang);
102
+ }
103
+ }());
@@ -0,0 +1,54 @@
1
+ (function () {
2
+ var lang = {
3
+ months : "januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),
4
+ monthsShort : "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),
5
+ weekdays : "söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),
6
+ weekdaysShort : "sön_mån_tis_ons_tor_fre_lör".split("_"),
7
+ longDateFormat : {
8
+ LT : "HH:mm",
9
+ L : "YYYY-MM-DD",
10
+ LL : "D MMMM YYYY",
11
+ LLL : "D MMMM YYYY LT",
12
+ LLLL : "dddd D MMMM YYYY LT"
13
+ },
14
+ calendar : {
15
+ sameDay: '[Idag klockan] LT',
16
+ nextDay: '[Imorgon klockan] LT',
17
+ lastDay: '[Igår klockan] LT',
18
+ nextWeek: 'dddd [klockan] LT',
19
+ lastWeek: '[Förra] dddd[en klockan] LT',
20
+ sameElse: 'L'
21
+ },
22
+ relativeTime : {
23
+ future : "om %s",
24
+ past : "för %s sen",
25
+ s : "några sekunder",
26
+ m : "en minut",
27
+ mm : "%d minuter",
28
+ h : "en timme",
29
+ hh : "%d timmar",
30
+ d : "en dag",
31
+ dd : "%d dagar",
32
+ M : "en månad",
33
+ MM : "%d månader",
34
+ y : "ett år",
35
+ yy : "%d år"
36
+ },
37
+ ordinal : function (number) {
38
+ var b = number % 10;
39
+ return (~~ (number % 100 / 10) === 1) ? 'e' :
40
+ (b === 1) ? 'a' :
41
+ (b === 2) ? 'a' :
42
+ (b === 3) ? 'e' : 'e';
43
+ }
44
+ };
45
+
46
+ // Node
47
+ if (typeof module !== 'undefined') {
48
+ module.exports = lang;
49
+ }
50
+ // Browser
51
+ if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
52
+ this.moment.lang('sv', lang);
53
+ }
54
+ }());
@@ -0,0 +1,54 @@
1
+ (function () {
2
+ var lang = {
3
+ months : "Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),
4
+ monthsShort : "Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),
5
+ weekdays : "Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),
6
+ weekdaysShort : "Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),
7
+ longDateFormat : {
8
+ LT : "HH:mm",
9
+ L : "DD.MM.YYYY",
10
+ LL : "D MMMM YYYY",
11
+ LLL : "D MMMM YYYY LT",
12
+ LLLL : "dddd, D MMMM YYYY LT"
13
+ },
14
+ calendar : {
15
+ sameDay : '[bugün saat] LT',
16
+ nextDay : '[yarın saat] LT',
17
+ nextWeek : '[haftaya] dddd [saat] LT',
18
+ lastDay : '[dün] LT',
19
+ lastWeek : '[geçen hafta] dddd [saat] LT',
20
+ sameElse : 'L'
21
+ },
22
+ relativeTime : {
23
+ future : "%s sonra",
24
+ past : "%s önce",
25
+ s : "birkaç saniye",
26
+ m : "bir dakika",
27
+ mm : "%d dakika",
28
+ h : "bir saat",
29
+ hh : "%d saat",
30
+ d : "bir gün",
31
+ dd : "%d gün",
32
+ M : "bir ay",
33
+ MM : "%d ay",
34
+ y : "bir yıl",
35
+ yy : "%d yıl"
36
+ },
37
+ ordinal : function (number) {
38
+ var b = number % 10;
39
+ return (~~ (number % 100 / 10) === 1) ? 'th' :
40
+ (b === 1) ? 'st' :
41
+ (b === 2) ? 'nd' :
42
+ (b === 3) ? 'rd' : 'th';
43
+ }
44
+ };
45
+
46
+ // Node
47
+ if (typeof module !== 'undefined') {
48
+ module.exports = lang;
49
+ }
50
+ // Browser
51
+ if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
52
+ this.moment.lang('tr', lang);
53
+ }
54
+ }());
@@ -0,0 +1,63 @@
1
+ (function () {
2
+ var lang = {
3
+ months : "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
4
+ monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
5
+ weekdays : "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
6
+ weekdaysShort : "周日_周一_周二_周三_周四_周五_周六".split("_"),
7
+ longDateFormat : {
8
+ LT : "Ah点mm",
9
+ L : "YYYY年MMMD日",
10
+ LL : "YYYY年MMMD日",
11
+ LLL : "YYYY年MMMD日LT",
12
+ LLLL : "YYYY年MMMD日ddddLT"
13
+ },
14
+ meridiem : function (hour, minute, isLower) {
15
+ if (hour < 9) {
16
+ return "早上";
17
+ } else if (hour < 11 && minute < 30) {
18
+ return "上午";
19
+ } else if (hour < 13 && minute < 30) {
20
+ return "中午";
21
+ } else if (hour < 18) {
22
+ return "下午";
23
+ } else {
24
+ return "晚上";
25
+ }
26
+ },
27
+ calendar : {
28
+ sameDay : '[今天]LT',
29
+ nextDay : '[明天]LT',
30
+ nextWeek : '[下]ddddLT',
31
+ lastDay : '[昨天]LT',
32
+ lastWeek : '[上]ddddLT',
33
+ sameElse : 'L'
34
+ },
35
+ relativeTime : {
36
+ future : "%s内",
37
+ past : "%s前",
38
+ s : "几秒",
39
+ m : "1分钟",
40
+ mm : "%d分钟",
41
+ h : "1小时",
42
+ hh : "%d小时",
43
+ d : "1天",
44
+ dd : "%d天",
45
+ M : "1个月",
46
+ MM : "%d个月",
47
+ y : "1年",
48
+ yy : "%d年"
49
+ },
50
+ ordinal : function (number) {
51
+ return '';
52
+ }
53
+ };
54
+
55
+ // Node
56
+ if (typeof module !== 'undefined') {
57
+ module.exports = lang;
58
+ }
59
+ // Browser
60
+ if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
61
+ this.moment.lang('zh-cn', lang);
62
+ }
63
+ }());
@@ -0,0 +1,63 @@
1
+ (function () {
2
+ var lang = {
3
+ months : "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
4
+ monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
5
+ weekdays : "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
6
+ weekdaysShort : "週日_週一_週二_週三_週四_週五_週六".split("_"),
7
+ longDateFormat : {
8
+ LT : "Ah點mm",
9
+ L : "YYYY年MMMD日",
10
+ LL : "YYYY年MMMD日",
11
+ LLL : "YYYY年MMMD日LT",
12
+ LLLL : "YYYY年MMMD日ddddLT"
13
+ },
14
+ meridiem : function (hour, minute, isLower) {
15
+ if (hour < 9) {
16
+ return "早上";
17
+ } else if (hour < 11 && minute < 30) {
18
+ return "上午";
19
+ } else if (hour < 13 && minute < 30) {
20
+ return "中午";
21
+ } else if (hour < 18) {
22
+ return "下午";
23
+ } else {
24
+ return "晚上";
25
+ }
26
+ },
27
+ calendar : {
28
+ sameDay : '[今天]LT',
29
+ nextDay : '[明天]LT',
30
+ nextWeek : '[下]ddddLT',
31
+ lastDay : '[昨天]LT',
32
+ lastWeek : '[上]ddddLT',
33
+ sameElse : 'L'
34
+ },
35
+ relativeTime : {
36
+ future : "%s內",
37
+ past : "%s前",
38
+ s : "幾秒",
39
+ m : "一分鐘",
40
+ mm : "%d分鐘",
41
+ h : "一小時",
42
+ hh : "%d小時",
43
+ d : "一天",
44
+ dd : "%d天",
45
+ M : "一個月",
46
+ MM : "%d個月",
47
+ y : "一年",
48
+ yy : "%d年"
49
+ },
50
+ ordinal : function (number) {
51
+ return '';
52
+ }
53
+ };
54
+
55
+ // Node
56
+ if (typeof module !== 'undefined') {
57
+ module.exports = lang;
58
+ }
59
+ // Browser
60
+ if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
61
+ this.moment.lang('zh-tw', lang);
62
+ }
63
+ }());