momentjs-rails 1.7.2 → 2.0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/README.md +1 -1
  2. data/{changelog.md → news.md} +30 -12
  3. data/test/dummy/Rakefile +7 -0
  4. data/test/dummy/config.ru +4 -0
  5. data/test/dummy/config/application.rb +65 -0
  6. data/test/dummy/config/boot.rb +10 -0
  7. data/test/dummy/config/environment.rb +5 -0
  8. data/test/dummy/config/environments/development.rb +31 -0
  9. data/test/dummy/config/environments/production.rb +64 -0
  10. data/test/dummy/config/environments/test.rb +35 -0
  11. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  12. data/test/dummy/config/initializers/inflections.rb +15 -0
  13. data/test/dummy/config/initializers/mime_types.rb +5 -0
  14. data/test/dummy/config/initializers/secret_token.rb +7 -0
  15. data/test/dummy/config/initializers/session_store.rb +8 -0
  16. data/test/dummy/config/initializers/wrap_parameters.rb +10 -0
  17. data/test/dummy/config/locales/en.yml +5 -0
  18. data/test/dummy/config/routes.rb +2 -0
  19. data/test/dummy/log/test.log +76 -0
  20. data/test/dummy/tmp/cache/assets/D1C/680/sprockets%2F16ed4d5afdb2919596e6f8790e2116c2 +0 -0
  21. data/test/dummy/tmp/cache/assets/D35/CA0/sprockets%2F493e64bce2d302801dc01cf7cd096a58 +0 -0
  22. data/test/dummy/tmp/cache/assets/D3F/5F0/sprockets%2F4a6c53eae7c6e41a69a191578bbb6417 +0 -0
  23. data/test/dummy/tmp/cache/assets/D58/BD0/sprockets%2F4de9ddc9b725c715a54c98697b2528fe +0 -0
  24. data/test/dummy/tmp/cache/assets/D75/510/sprockets%2Fe690787ac522f47a6be024bfcc1767ee +0 -0
  25. data/test/dummy/tmp/cache/assets/E10/250/sprockets%2Fe4badb9ddfda484eb9671bf88567be61 +0 -0
  26. data/test/integration/navigation_test.rb +14 -0
  27. data/test/momentjs-rails_test.rb +7 -0
  28. data/test/test_helper.rb +15 -0
  29. data/vendor/assets/javascripts/moment.js +542 -355
  30. data/vendor/assets/javascripts/moment/ar-ma.js +46 -0
  31. data/vendor/assets/javascripts/moment/ar.js +45 -0
  32. data/vendor/assets/javascripts/moment/bg.js +71 -61
  33. data/vendor/assets/javascripts/moment/ca.js +51 -59
  34. data/vendor/assets/javascripts/moment/cs.js +145 -0
  35. data/vendor/assets/javascripts/moment/cv.js +45 -53
  36. data/vendor/assets/javascripts/moment/da.js +41 -49
  37. data/vendor/assets/javascripts/moment/de.js +41 -49
  38. data/vendor/assets/javascripts/moment/en-ca.js +44 -53
  39. data/vendor/assets/javascripts/moment/en-gb.js +48 -53
  40. data/vendor/assets/javascripts/moment/eo.js +55 -0
  41. data/vendor/assets/javascripts/moment/es.js +51 -59
  42. data/vendor/assets/javascripts/moment/et.js +44 -61
  43. data/vendor/assets/javascripts/moment/eu.js +46 -50
  44. data/vendor/assets/javascripts/moment/fi.js +84 -89
  45. data/vendor/assets/javascripts/moment/fr-ca.js +39 -49
  46. data/vendor/assets/javascripts/moment/fr.js +43 -49
  47. data/vendor/assets/javascripts/moment/gl.js +51 -59
  48. data/vendor/assets/javascripts/moment/he.js +46 -0
  49. data/vendor/assets/javascripts/moment/hu.js +77 -98
  50. data/vendor/assets/javascripts/moment/id.js +57 -0
  51. data/vendor/assets/javascripts/moment/is.js +103 -121
  52. data/vendor/assets/javascripts/moment/it.js +41 -49
  53. data/vendor/assets/javascripts/moment/ja.js +43 -56
  54. data/vendor/assets/javascripts/moment/ko.js +42 -54
  55. data/vendor/assets/javascripts/moment/lv.js +67 -0
  56. data/vendor/assets/javascripts/moment/nb.js +41 -49
  57. data/vendor/assets/javascripts/moment/ne.js +95 -0
  58. data/vendor/assets/javascripts/moment/nl.js +52 -57
  59. data/vendor/assets/javascripts/moment/pl.js +73 -70
  60. data/vendor/assets/javascripts/moment/pt-br.js +42 -54
  61. data/vendor/assets/javascripts/moment/pt.js +45 -53
  62. data/vendor/assets/javascripts/moment/ro.js +40 -49
  63. data/vendor/assets/javascripts/moment/ru.js +105 -114
  64. data/vendor/assets/javascripts/moment/sl.js +134 -0
  65. data/vendor/assets/javascripts/moment/sv.js +48 -53
  66. data/vendor/assets/javascripts/moment/th.js +48 -0
  67. data/vendor/assets/javascripts/moment/tr.js +69 -75
  68. data/vendor/assets/javascripts/moment/tzm-la.js +45 -0
  69. data/vendor/assets/javascripts/moment/tzm.js +45 -0
  70. data/vendor/assets/javascripts/moment/uk.js +122 -0
  71. data/vendor/assets/javascripts/moment/zh-cn.js +53 -62
  72. data/vendor/assets/javascripts/moment/zh-tw.js +53 -62
  73. metadata +121 -54
  74. data/vendor/assets/javascripts/moment/jp.js +0 -64
  75. data/vendor/assets/javascripts/moment/kr.js +0 -61
@@ -0,0 +1,55 @@
1
+ // moment.js language configuration
2
+ // language : esperanto (eo)
3
+ // author : Colin Dean : https://github.com/colindean
4
+ // komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko.
5
+ // Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni!
6
+
7
+ require('../moment').lang('eo', {
8
+ months : "januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),
9
+ monthsShort : "jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),
10
+ weekdays : "Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),
11
+ weekdaysShort : "Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),
12
+ weekdaysMin : "Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),
13
+ longDateFormat : {
14
+ LT : "HH:mm",
15
+ L : "YYYY-MM-DD",
16
+ LL : "D-\\an \\de MMMM, YYYY",
17
+ LLL : "D-\\an \\de MMMM, YYYY LT",
18
+ LLLL : "dddd, \\l\\a D-\\an \\d\\e MMMM, YYYY LT"
19
+ },
20
+ meridiem : function (hours, minutes, isLower) {
21
+ if (hours > 11) {
22
+ return isLower ? 'p.t.m.' : 'P.T.M.';
23
+ } else {
24
+ return isLower ? 'a.t.m.' : 'A.T.M.';
25
+ }
26
+ },
27
+ calendar : {
28
+ sameDay : '[Hodiaŭ je] LT',
29
+ nextDay : '[Morgaŭ je] LT',
30
+ nextWeek : 'dddd [je] LT',
31
+ lastDay : '[Hieraŭ je] LT',
32
+ lastWeek : '[pasinta] dddd [je] LT',
33
+ sameElse : 'L'
34
+ },
35
+ relativeTime : {
36
+ future : "je %s",
37
+ past : "antaŭ %s",
38
+ s : "sekundoj",
39
+ m : "minuto",
40
+ mm : "%d minutoj",
41
+ h : "horo",
42
+ hh : "%d horoj",
43
+ d : "tago",//ne 'diurno', ĉar estas uzita por proksimumo
44
+ dd : "%d tagoj",
45
+ M : "monato",
46
+ MM : "%d monatoj",
47
+ y : "jaro",
48
+ yy : "%d jaroj"
49
+ },
50
+ ordinal : "%da",
51
+ week : {
52
+ dow : 1, // Monday is the first day of the week.
53
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
54
+ }
55
+ });
@@ -1,64 +1,56 @@
1
1
  // moment.js language configuration
2
2
  // language : spanish (es)
3
3
  // author : Julio Napurí : https://github.com/julionc
4
- (function () {
5
- var lang = {
6
- months : "Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),
7
- monthsShort : "Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_"),
8
- weekdays : "Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),
9
- weekdaysShort : "Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),
10
- weekdaysMin : "Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),
11
- longDateFormat : {
12
- LT : "H:mm",
13
- L : "DD/MM/YYYY",
14
- LL : "D MMMM YYYY",
15
- LLL : "D MMMM YYYY LT",
16
- LLLL : "dddd D MMMM YYYY LT"
17
- },
18
- calendar : {
19
- sameDay : function () {
20
- return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
21
- },
22
- nextDay : function () {
23
- return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
24
- },
25
- nextWeek : function () {
26
- return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
27
- },
28
- lastDay : function () {
29
- return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
30
- },
31
- lastWeek : function () {
32
- return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
33
- },
34
- sameElse : 'L'
35
- },
36
- relativeTime : {
37
- future : "en %s",
38
- past : "hace %s",
39
- s : "unos segundos",
40
- m : "un minuto",
41
- mm : "%d minutos",
42
- h : "una hora",
43
- hh : "%d horas",
44
- d : "un día",
45
- dd : "%d días",
46
- M : "un mes",
47
- MM : "%d meses",
48
- y : "un año",
49
- yy : "%d años"
50
- },
51
- ordinal : function (number) {
52
- return 'º';
53
- }
54
- };
55
4
 
56
- // Node
57
- if (typeof module !== 'undefined' && module.exports) {
58
- module.exports = lang;
5
+ require('../moment').lang('es', {
6
+ months : "enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),
7
+ monthsShort : "ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),
8
+ weekdays : "domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),
9
+ weekdaysShort : "dom._lun._mar._mié._jue._vie._sáb.".split("_"),
10
+ weekdaysMin : "Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),
11
+ longDateFormat : {
12
+ LT : "H:mm",
13
+ L : "DD/MM/YYYY",
14
+ LL : "D \\de MMMM \\de YYYY",
15
+ LLL : "D \\de MMMM \\de YYYY LT",
16
+ LLLL : "dddd, D \\de MMMM \\de YYYY LT"
17
+ },
18
+ calendar : {
19
+ sameDay : function () {
20
+ return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
21
+ },
22
+ nextDay : function () {
23
+ return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
24
+ },
25
+ nextWeek : function () {
26
+ return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
27
+ },
28
+ lastDay : function () {
29
+ return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
30
+ },
31
+ lastWeek : function () {
32
+ return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
33
+ },
34
+ sameElse : 'L'
35
+ },
36
+ relativeTime : {
37
+ future : "en %s",
38
+ past : "hace %s",
39
+ s : "unos segundos",
40
+ m : "un minuto",
41
+ mm : "%d minutos",
42
+ h : "una hora",
43
+ hh : "%d horas",
44
+ d : "un día",
45
+ dd : "%d días",
46
+ M : "un mes",
47
+ MM : "%d meses",
48
+ y : "un año",
49
+ yy : "%d años"
50
+ },
51
+ ordinal : '%dº',
52
+ week : {
53
+ dow : 1, // Monday is the first day of the week.
54
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
59
55
  }
60
- // Browser
61
- if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
62
- this.moment.lang('es', lang);
63
- }
64
- }());
56
+ });
@@ -1,67 +1,50 @@
1
1
  // moment.js language configuration
2
2
  // language : estonian (et)
3
3
  // author : Henry Kehlmann : https://github.com/madhenry
4
- (function () {
5
4
 
6
- function translate(number, withoutSuffix, key, isFuture) {
7
- var num = number;
8
-
9
- switch (key) {
10
- case 's':
11
- return (isFuture || withoutSuffix) ? 'paari sekundi' : 'paar sekundit';
12
- default:
13
- }
14
-
15
- return '';
16
- }
17
-
18
- var lang = {
19
- months : "jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),
20
- monthsShort : "jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),
21
- weekdays : "pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),
22
- weekdaysShort : "P_E_T_K_N_R_L".split("_"),
23
- weekdaysMin : "P_E_T_K_N_R_L".split("_"),
24
- longDateFormat : {
25
- LT : "H:mm",
26
- L : "DD.MM.YYYY",
27
- LL : "D. MMMM YYYY",
28
- LLL : "D. MMMM YYYY LT",
29
- LLLL : "dddd, D. MMMM YYYY LT"
30
- },
31
- calendar : {
32
- sameDay : '[Täna,] LT',
33
- nextDay : '[Homme,] LT',
34
- nextWeek : '[Järgmine] dddd LT',
35
- lastDay : '[Eile,] LT',
36
- lastWeek : '[Eelmine] dddd LT',
37
- sameElse : 'L'
38
- },
39
- relativeTime : {
40
- future : "%s pärast",
41
- past : "%s tagasi",
42
- s : translate,
43
- m : "minut",
44
- mm : "%d minutit",
45
- h : "tund",
46
- hh : "%d tundi",
47
- d : "päev",
48
- dd : "%d päeva",
49
- M : "kuu",
50
- MM : "%d kuud",
51
- y : "aasta",
52
- yy : "%d aastat"
53
- },
54
- ordinal : function (number) {
55
- return '.';
56
- }
57
- };
5
+ function translateSeconds(number, withoutSuffix, key, isFuture) {
6
+ return (isFuture || withoutSuffix) ? 'paari sekundi' : 'paar sekundit';
7
+ }
58
8
 
59
- // Node
60
- if (typeof module !== 'undefined' && module.exports) {
61
- module.exports = lang;
62
- }
63
- // Browser
64
- if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
65
- this.moment.lang('et', lang);
9
+ require('../moment').lang('et', {
10
+ months : "jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),
11
+ monthsShort : "jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),
12
+ weekdays : "pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),
13
+ weekdaysShort : "P_E_T_K_N_R_L".split("_"),
14
+ weekdaysMin : "P_E_T_K_N_R_L".split("_"),
15
+ longDateFormat : {
16
+ LT : "H:mm",
17
+ L : "DD.MM.YYYY",
18
+ LL : "D. MMMM YYYY",
19
+ LLL : "D. MMMM YYYY LT",
20
+ LLLL : "dddd, D. MMMM YYYY LT"
21
+ },
22
+ calendar : {
23
+ sameDay : '[Täna,] LT',
24
+ nextDay : '[Homme,] LT',
25
+ nextWeek : '[Järgmine] dddd LT',
26
+ lastDay : '[Eile,] LT',
27
+ lastWeek : '[Eelmine] dddd LT',
28
+ sameElse : 'L'
29
+ },
30
+ relativeTime : {
31
+ future : "%s pärast",
32
+ past : "%s tagasi",
33
+ s : translateSeconds,
34
+ m : "minut",
35
+ mm : "%d minutit",
36
+ h : "tund",
37
+ hh : "%d tundi",
38
+ d : "päev",
39
+ dd : "%d päeva",
40
+ M : "kuu",
41
+ MM : "%d kuud",
42
+ y : "aasta",
43
+ yy : "%d aastat"
44
+ },
45
+ ordinal : '%d.',
46
+ week : {
47
+ dow : 1, // Monday is the first day of the week.
48
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
66
49
  }
67
- }());
50
+ });
@@ -1,54 +1,50 @@
1
1
  // moment.js language configuration
2
2
  // language : euskara (eu)
3
3
  // author : Eneko Illarramendi : https://github.com/eillarra
4
- (function () {
5
- var lang = {
6
- months : "urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),
7
- monthsShort : "urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),
8
- weekdays : "igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),
9
- weekdaysShort : "ig._al._ar._az._og._ol._lr.".split("_"),
10
- weekdaysMin : "ig_al_ar_az_og_ol_lr".split("_"),
11
- longDateFormat : {
12
- LT : "HH:mm",
13
- L : "YYYY-MM-DD",
14
- LL : "YYYYko MMMMren D[a]",
15
- LLL : "YYYYko MMMMren D[a] LT",
16
- LLLL : "dddd, YYYYko MMMMren D[a] LT"
17
- },
18
- calendar : {
19
- sameDay : '[gaur] LT[etan]',
20
- nextDay : '[bihar] LT[etan]',
21
- nextWeek : 'dddd LT[etan]',
22
- lastDay : '[atzo] LT[etan]',
23
- lastWeek : '[aurreko] dddd LT[etan]',
24
- sameElse : 'L'
25
- },
26
- relativeTime : {
27
- future : "%s barru",
28
- past : "duela %s",
29
- s : "segundo batzuk",
30
- m : "minutu bat",
31
- mm : "%d minutu",
32
- h : "ordu bat",
33
- hh : "%d ordu",
34
- d : "egun bat",
35
- dd : "%d egun",
36
- M : "hilabete bat",
37
- MM : "%d hilabete",
38
- y : "urte bat",
39
- yy : "%d urte"
40
- },
41
- ordinal : function (number) {
42
- return '.';
43
- }
44
- };
45
-
46
- // Node
47
- if (typeof module !== 'undefined' && module.exports) {
48
- module.exports = lang;
4
+
5
+ require('../moment').lang('eu', {
6
+ months : "urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),
7
+ monthsShort : "urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),
8
+ weekdays : "igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),
9
+ weekdaysShort : "ig._al._ar._az._og._ol._lr.".split("_"),
10
+ weekdaysMin : "ig_al_ar_az_og_ol_lr".split("_"),
11
+ longDateFormat : {
12
+ LT : "HH:mm",
13
+ L : "YYYY-MM-DD",
14
+ LL : "YYYYko MMMMren D[a]",
15
+ LLL : "YYYYko MMMMren D[a] LT",
16
+ LLLL : "dddd, YYYYko MMMMren D[a] LT",
17
+ l : "YYYY-M-D",
18
+ ll : "YYYYko MMM D[a]",
19
+ lll : "YYYYko MMM D[a] LT",
20
+ llll : "ddd, YYYYko MMM D[a] LT"
21
+ },
22
+ calendar : {
23
+ sameDay : '[gaur] LT[etan]',
24
+ nextDay : '[bihar] LT[etan]',
25
+ nextWeek : 'dddd LT[etan]',
26
+ lastDay : '[atzo] LT[etan]',
27
+ lastWeek : '[aurreko] dddd LT[etan]',
28
+ sameElse : 'L'
29
+ },
30
+ relativeTime : {
31
+ future : "%s barru",
32
+ past : "duela %s",
33
+ s : "segundo batzuk",
34
+ m : "minutu bat",
35
+ mm : "%d minutu",
36
+ h : "ordu bat",
37
+ hh : "%d ordu",
38
+ d : "egun bat",
39
+ dd : "%d egun",
40
+ M : "hilabete bat",
41
+ MM : "%d hilabete",
42
+ y : "urte bat",
43
+ yy : "%d urte"
44
+ },
45
+ ordinal : '%d.',
46
+ week : {
47
+ dow : 1, // Monday is the first day of the week.
48
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
49
49
  }
50
- // Browser
51
- if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
52
- this.moment.lang('eu', lang);
53
- }
54
- }());
50
+ });
@@ -1,98 +1,93 @@
1
1
  // moment.js language configuration
2
2
  // language : finnish (fi)
3
3
  // author : Tarmo Aidantausta : https://github.com/bleadof
4
- (function () {
5
- var numbers_past = ['nolla', 'yksi', 'kaksi', 'kolme', 'neljä', 'viisi',
6
- 'kuusi', 'seitsemän', 'kahdeksan', 'yhdeksän'];
7
- var numbers_future = ['nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden',
8
- 'kuuden', numbers_past[7], numbers_past[8], numbers_past[9]];
9
4
 
10
- function translate(number, withoutSuffix, key, isFuture) {
11
- var result = "";
12
- switch (key) {
13
- case 's':
14
- return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
15
- case 'm':
16
- return isFuture ? 'minuutin' : 'minuutti';
17
- case 'mm':
18
- result = isFuture ? 'minuutin' : 'minuuttia';
19
- break;
20
- case 'h':
21
- return isFuture ? 'tunnin' : 'tunti';
22
- case 'hh':
23
- result = isFuture ? 'tunnin' : 'tuntia';
24
- break;
25
- case 'd':
26
- return isFuture ? 'päivän' : 'päivä';
27
- case 'dd':
28
- result = isFuture ? 'päivän' : 'päivää';
29
- break;
30
- case 'M':
31
- return isFuture ? 'kuukauden' : 'kuukausi';
32
- case 'MM':
33
- result = isFuture ? 'kuukauden' : 'kuukautta';
34
- break;
35
- case 'y':
36
- return isFuture ? 'vuoden' : 'vuosi';
37
- case 'yy':
38
- result = isFuture ? 'vuoden' : 'vuotta';
39
- break;
40
- }
41
- result = verbal_number(number, isFuture) + " " + result;
42
- return result;
43
- }
5
+ var numbers_past = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '),
6
+ numbers_future = ['nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',
7
+ numbers_past[7], numbers_past[8], numbers_past[9]];
44
8
 
45
- function verbal_number(number, isFuture) {
46
- return number < 10 ? (isFuture ? numbers_future[number] : numbers_past[number]) : number;
9
+ function translate(number, withoutSuffix, key, isFuture) {
10
+ var result = "";
11
+ switch (key) {
12
+ case 's':
13
+ return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
14
+ case 'm':
15
+ return isFuture ? 'minuutin' : 'minuutti';
16
+ case 'mm':
17
+ result = isFuture ? 'minuutin' : 'minuuttia';
18
+ break;
19
+ case 'h':
20
+ return isFuture ? 'tunnin' : 'tunti';
21
+ case 'hh':
22
+ result = isFuture ? 'tunnin' : 'tuntia';
23
+ break;
24
+ case 'd':
25
+ return isFuture ? 'päivän' : 'päivä';
26
+ case 'dd':
27
+ result = isFuture ? 'päivän' : 'päivää';
28
+ break;
29
+ case 'M':
30
+ return isFuture ? 'kuukauden' : 'kuukausi';
31
+ case 'MM':
32
+ result = isFuture ? 'kuukauden' : 'kuukautta';
33
+ break;
34
+ case 'y':
35
+ return isFuture ? 'vuoden' : 'vuosi';
36
+ case 'yy':
37
+ result = isFuture ? 'vuoden' : 'vuotta';
38
+ break;
47
39
  }
40
+ result = verbal_number(number, isFuture) + " " + result;
41
+ return result;
42
+ }
48
43
 
49
- var lang = {
50
- months : "tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),
51
- monthsShort : "tam_hel_maa_huh_tou_kes_hei_elo_syy_lok_mar_jou".split("_"),
52
- weekdays : "sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),
53
- weekdaysShort : "su_ma_ti_ke_to_pe_la".split("_"),
54
- weekdaysMin : "su_ma_ti_ke_to_pe_la".split("_"),
55
- longDateFormat : {
56
- LT : "HH.mm",
57
- L : "DD.MM.YYYY",
58
- LL : "Do MMMMt\\a YYYY",
59
- LLL : "Do MMMMt\\a YYYY, klo LT",
60
- LLLL : "dddd, Do MMMMt\\a YYYY, klo LT"
61
- },
62
- calendar : {
63
- sameDay : '[tänään] [klo] LT',
64
- nextDay : '[huomenna] [klo] LT',
65
- nextWeek : 'dddd [klo] LT',
66
- lastDay : '[eilen] [klo] LT',
67
- lastWeek : '[viime] dddd[na] [klo] LT',
68
- sameElse : 'L'
69
- },
70
- relativeTime : {
71
- future : "%s päästä",
72
- past : "%s sitten",
73
- s : translate,
74
- m : translate,
75
- mm : translate,
76
- h : translate,
77
- hh : translate,
78
- d : translate,
79
- dd : translate,
80
- M : translate,
81
- MM : translate,
82
- y : translate,
83
- yy : translate
84
- },
85
- ordinal : function (number) {
86
- return ".";
87
- }
88
- };
44
+ function verbal_number(number, isFuture) {
45
+ return number < 10 ? (isFuture ? numbers_future[number] : numbers_past[number]) : number;
46
+ }
89
47
 
90
- // Node
91
- if (typeof module !== 'undefined' && module.exports) {
92
- module.exports = lang;
93
- }
94
- // Browser
95
- if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
96
- this.moment.lang('fi', lang);
48
+ require('../moment').lang('fi', {
49
+ months : "tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),
50
+ monthsShort : "tam_hel_maa_huh_tou_kes_hei_elo_syy_lok_mar_jou".split("_"),
51
+ weekdays : "sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),
52
+ weekdaysShort : "su_ma_ti_ke_to_pe_la".split("_"),
53
+ weekdaysMin : "su_ma_ti_ke_to_pe_la".split("_"),
54
+ longDateFormat : {
55
+ LT : "HH.mm",
56
+ L : "DD.MM.YYYY",
57
+ LL : "Do MMMM[ta] YYYY",
58
+ LLL : "Do MMMM[ta] YYYY, [klo] LT",
59
+ LLLL : "dddd, Do MMMM[ta] YYYY, [klo] LT",
60
+ l : "D.M.YYYY",
61
+ ll : "Do MMM YYYY",
62
+ lll : "Do MMM YYYY, [klo] LT",
63
+ llll : "ddd, Do MMM YYYY, [klo] LT"
64
+ },
65
+ calendar : {
66
+ sameDay : '[tänään] [klo] LT',
67
+ nextDay : '[huomenna] [klo] LT',
68
+ nextWeek : 'dddd [klo] LT',
69
+ lastDay : '[eilen] [klo] LT',
70
+ lastWeek : '[viime] dddd[na] [klo] LT',
71
+ sameElse : 'L'
72
+ },
73
+ relativeTime : {
74
+ future : "%s päästä",
75
+ past : "%s sitten",
76
+ s : translate,
77
+ m : translate,
78
+ mm : translate,
79
+ h : translate,
80
+ hh : translate,
81
+ d : translate,
82
+ dd : translate,
83
+ M : translate,
84
+ MM : translate,
85
+ y : translate,
86
+ yy : translate
87
+ },
88
+ ordinal : "%d.",
89
+ week : {
90
+ dow : 1, // Monday is the first day of the week.
91
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
97
92
  }
98
- }());
93
+ });