momentjs-rails 2.29.1 → 2.29.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/news.md +9 -0
  4. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/0t/0ty_fqRlzF-hGYQebubBsuGgCeT9YnqkULkaCu1nwMk.cache +0 -0
  5. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/{3T/3TjWGZFWBLAEGSW7kQIDJIL6_MukMwz_wLDMwgYsN1E.cache → 3D/3DLOuccQFCZCWz_kmyP6PagEyQM5ne4ONIzBwdwG-fY.cache} +0 -0
  6. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/3h/3hk-k7Z5qoOh6S1dyiOjpfiwRfblMf4NpG3NVkO_4GQ.cache +1 -0
  7. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/{9C/9Cy8L_tqI8SvH-pVigMqBlPTus4vnZvt3YE2y8--beE.cache → 81/81FXcACo3ySybaa-2mJ9JsZ4xXvXxgi6rAT9sildrVs.cache} +1 -1
  8. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/{JO/JO9QyaKhLUs4VF1ODPXLiqcSziQS4x3sudms-3GYjww.cache → 97/97gKfWGwqo7IhT-5nqdT3p547QEt2G9nbmU5XVAtEeE.cache} +1 -1
  9. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/GO/GOYA_gO9tZqOtwNUptOfYUG1F6q5BF1ZZI0Wr7itvYM.cache +1 -0
  10. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/NG/NGyfZ_kRU3oHnf8bEjRHJwpjyx0NF_U8V_ENdenCoIg.cache +1 -0
  11. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/{3e/3eGeoVsqjktkiAfNQ4zBuxtb0rtVWyQsKgjho5OHYnY.cache → R9/R9pPKpyMZFVnjZL7kwY21faYzV2WpIx_hPb5GrUown8.cache} +0 -0
  12. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/{Ru/RuQ9HENefRmSoZaLfw7LalsxdBHpKJMyc2c3OQ_kQr8.cache → W1/W1cCnSuixTbIt3rgc5Z-4BGC1iBfw6gqKVjuOh66lSY.cache} +0 -0
  13. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Xr/Xr9AioDZNswMqHmbREXo4J_kNVPlbysC8G37BX65-rY.cache +0 -0
  14. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/lK/lKG81FVPPHkSni295teRgLDoWVYRamY_BCSFxMiagSs.cache +1 -0
  15. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/q7/q7CVcZSJHIEQqdPLpSAb4YHepJZFY541_7ToMaHvbtA.cache +0 -0
  16. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/{Zj/Zjn9OiwGREdMXvLZA-tY289lQslnn7R3BrSwhsntMWQ.cache → wF/wFKYFOm2u1A3crk6JyBKUw2L5ybvI0Tbt2jPPZXfdWQ.cache} +0 -0
  17. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/yY/yY97dYnGEDUjVioT9bUJucvTt0w_ToimRXWj3YYvD10.cache +0 -0
  18. data/test/integration/navigation_test.rb +1 -1
  19. data/vendor/assets/javascripts/moment/af.js +77 -66
  20. data/vendor/assets/javascripts/moment/ar-dz.js +156 -145
  21. data/vendor/assets/javascripts/moment/ar-kw.js +61 -49
  22. data/vendor/assets/javascripts/moment/ar-ly.js +176 -165
  23. data/vendor/assets/javascripts/moment/ar-ma.js +61 -49
  24. data/vendor/assets/javascripts/moment/ar-sa.js +110 -98
  25. data/vendor/assets/javascripts/moment/ar-tn.js +61 -49
  26. data/vendor/assets/javascripts/moment/ar.js +191 -180
  27. data/vendor/assets/javascripts/moment/az.js +107 -95
  28. data/vendor/assets/javascripts/moment/be.js +141 -129
  29. data/vendor/assets/javascripts/moment/bg.js +91 -80
  30. data/vendor/assets/javascripts/moment/bm.js +57 -47
  31. data/vendor/assets/javascripts/moment/bn-bd.js +132 -120
  32. data/vendor/assets/javascripts/moment/bn.js +124 -112
  33. data/vendor/assets/javascripts/moment/bo.js +129 -116
  34. data/vendor/assets/javascripts/moment/br.js +165 -151
  35. data/vendor/assets/javascripts/moment/bs.js +151 -139
  36. data/vendor/assets/javascripts/moment/ca.js +101 -87
  37. data/vendor/assets/javascripts/moment/cs.js +181 -161
  38. data/vendor/assets/javascripts/moment/cv.js +68 -56
  39. data/vendor/assets/javascripts/moment/cy.js +102 -90
  40. data/vendor/assets/javascripts/moment/da.js +59 -48
  41. data/vendor/assets/javascripts/moment/de-at.js +81 -70
  42. data/vendor/assets/javascripts/moment/de-ch.js +80 -71
  43. data/vendor/assets/javascripts/moment/de.js +81 -70
  44. data/vendor/assets/javascripts/moment/dv.js +95 -84
  45. data/vendor/assets/javascripts/moment/el.js +109 -96
  46. data/vendor/assets/javascripts/moment/en-au.js +74 -63
  47. data/vendor/assets/javascripts/moment/en-ca.js +70 -59
  48. data/vendor/assets/javascripts/moment/en-gb.js +74 -63
  49. data/vendor/assets/javascripts/moment/en-ie.js +74 -63
  50. data/vendor/assets/javascripts/moment/en-il.js +70 -59
  51. data/vendor/assets/javascripts/moment/en-in.js +74 -63
  52. data/vendor/assets/javascripts/moment/en-nz.js +74 -63
  53. data/vendor/assets/javascripts/moment/en-sg.js +74 -63
  54. data/vendor/assets/javascripts/moment/eo.js +71 -60
  55. data/vendor/assets/javascripts/moment/es-do.js +109 -94
  56. data/vendor/assets/javascripts/moment/es-mx.js +110 -95
  57. data/vendor/assets/javascripts/moment/es-us.js +109 -94
  58. data/vendor/assets/javascripts/moment/es.js +110 -95
  59. data/vendor/assets/javascripts/moment/et.js +81 -70
  60. data/vendor/assets/javascripts/moment/eu.js +71 -58
  61. data/vendor/assets/javascripts/moment/fa.js +118 -104
  62. data/vendor/assets/javascripts/moment/fi.js +128 -114
  63. data/vendor/assets/javascripts/moment/fil.js +63 -52
  64. data/vendor/assets/javascripts/moment/fo.js +62 -50
  65. data/vendor/assets/javascripts/moment/fr-ca.js +75 -63
  66. data/vendor/assets/javascripts/moment/fr-ch.js +79 -67
  67. data/vendor/assets/javascripts/moment/fr.js +111 -96
  68. data/vendor/assets/javascripts/moment/fy.js +80 -71
  69. data/vendor/assets/javascripts/moment/ga.js +100 -89
  70. data/vendor/assets/javascripts/moment/gd.js +100 -89
  71. data/vendor/assets/javascripts/moment/gl.js +77 -65
  72. data/vendor/assets/javascripts/moment/gom-deva.js +131 -118
  73. data/vendor/assets/javascripts/moment/gom-latn.js +129 -118
  74. data/vendor/assets/javascripts/moment/gu.js +127 -115
  75. data/vendor/assets/javascripts/moment/he.js +93 -82
  76. data/vendor/assets/javascripts/moment/hi.js +167 -152
  77. data/vendor/assets/javascripts/moment/hr.js +156 -143
  78. data/vendor/assets/javascripts/moment/hu.js +119 -108
  79. data/vendor/assets/javascripts/moment/hy-am.js +98 -85
  80. data/vendor/assets/javascripts/moment/id.js +81 -70
  81. data/vendor/assets/javascripts/moment/is.js +138 -126
  82. data/vendor/assets/javascripts/moment/it-ch.js +68 -57
  83. data/vendor/assets/javascripts/moment/it.js +106 -95
  84. data/vendor/assets/javascripts/moment/ja.js +146 -135
  85. data/vendor/assets/javascripts/moment/jv.js +81 -70
  86. data/vendor/assets/javascripts/moment/ka.js +92 -81
  87. data/vendor/assets/javascripts/moment/kk.js +87 -76
  88. data/vendor/assets/javascripts/moment/km.js +108 -96
  89. data/vendor/assets/javascripts/moment/kn.js +129 -117
  90. data/vendor/assets/javascripts/moment/ko.js +80 -69
  91. data/vendor/assets/javascripts/moment/ku.js +123 -112
  92. data/vendor/assets/javascripts/moment/ky.js +89 -78
  93. data/vendor/assets/javascripts/moment/lb.js +134 -121
  94. data/vendor/assets/javascripts/moment/lo.js +72 -60
  95. data/vendor/assets/javascripts/moment/lt.js +127 -114
  96. data/vendor/assets/javascripts/moment/lv.js +97 -85
  97. data/vendor/assets/javascripts/moment/me.js +119 -109
  98. data/vendor/assets/javascripts/moment/mi.js +66 -54
  99. data/vendor/assets/javascripts/moment/mk.js +90 -78
  100. data/vendor/assets/javascripts/moment/ml.js +88 -75
  101. data/vendor/assets/javascripts/moment/mn.js +101 -89
  102. data/vendor/assets/javascripts/moment/mr.js +204 -192
  103. data/vendor/assets/javascripts/moment/ms-my.js +81 -70
  104. data/vendor/assets/javascripts/moment/ms.js +81 -70
  105. data/vendor/assets/javascripts/moment/mt.js +62 -50
  106. data/vendor/assets/javascripts/moment/my.js +93 -82
  107. data/vendor/assets/javascripts/moment/nb.js +64 -54
  108. data/vendor/assets/javascripts/moment/ne.js +126 -114
  109. data/vendor/assets/javascripts/moment/nl-be.js +103 -92
  110. data/vendor/assets/javascripts/moment/nl.js +105 -94
  111. data/vendor/assets/javascripts/moment/nn.js +64 -54
  112. data/vendor/assets/javascripts/moment/oc-lnc.js +89 -76
  113. data/vendor/assets/javascripts/moment/pa-in.js +127 -115
  114. data/vendor/assets/javascripts/moment/pl.js +138 -126
  115. data/vendor/assets/javascripts/moment/pt-br.js +63 -51
  116. data/vendor/assets/javascripts/moment/pt.js +68 -56
  117. data/vendor/assets/javascripts/moment/ro.js +78 -66
  118. data/vendor/assets/javascripts/moment/ru.js +204 -186
  119. data/vendor/assets/javascripts/moment/sd.js +86 -75
  120. data/vendor/assets/javascripts/moment/se.js +63 -52
  121. data/vendor/assets/javascripts/moment/si.js +75 -63
  122. data/vendor/assets/javascripts/moment/sk.js +146 -134
  123. data/vendor/assets/javascripts/moment/sl.js +172 -160
  124. data/vendor/assets/javascripts/moment/sq.js +69 -58
  125. data/vendor/assets/javascripts/moment/sr-cyrl.js +128 -106
  126. data/vendor/assets/javascripts/moment/sr.js +130 -108
  127. data/vendor/assets/javascripts/moment/ss.js +89 -77
  128. data/vendor/assets/javascripts/moment/sv.js +74 -63
  129. data/vendor/assets/javascripts/moment/sw.js +61 -49
  130. data/vendor/assets/javascripts/moment/ta.js +136 -123
  131. data/vendor/assets/javascripts/moment/te.js +94 -81
  132. data/vendor/assets/javascripts/moment/tet.js +72 -61
  133. data/vendor/assets/javascripts/moment/tg.js +120 -108
  134. data/vendor/assets/javascripts/moment/th.js +71 -59
  135. data/vendor/assets/javascripts/moment/tk.js +96 -85
  136. data/vendor/assets/javascripts/moment/tl-ph.js +63 -52
  137. data/vendor/assets/javascripts/moment/tlh.js +122 -112
  138. data/vendor/assets/javascripts/moment/tr.js +110 -99
  139. data/vendor/assets/javascripts/moment/tzl.js +93 -82
  140. data/vendor/assets/javascripts/moment/tzm-latn.js +60 -48
  141. data/vendor/assets/javascripts/moment/tzm.js +60 -48
  142. data/vendor/assets/javascripts/moment/ug-cn.js +116 -104
  143. data/vendor/assets/javascripts/moment/uk.js +163 -148
  144. data/vendor/assets/javascripts/moment/ur.js +86 -75
  145. data/vendor/assets/javascripts/moment/uz-latn.js +60 -48
  146. data/vendor/assets/javascripts/moment/uz.js +57 -46
  147. data/vendor/assets/javascripts/moment/vi.js +85 -73
  148. data/vendor/assets/javascripts/moment/x-pseudo.js +79 -66
  149. data/vendor/assets/javascripts/moment/yo.js +59 -48
  150. data/vendor/assets/javascripts/moment/zh-cn.js +118 -107
  151. data/vendor/assets/javascripts/moment/zh-hk.js +104 -93
  152. data/vendor/assets/javascripts/moment/zh-mo.js +104 -93
  153. data/vendor/assets/javascripts/moment/zh-tw.js +104 -93
  154. data/vendor/assets/javascripts/moment.js +5037 -5014
  155. metadata +30 -58
  156. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/-H/-H77gbOgi-dwHJoevs2PsAJBV-nde7DFDWBPXqUrMkw.cache +0 -1
  157. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/-y/-ypqz4WBYM3Qftk20RenhtH0iPKxdtyu6t3hVOjJLL4.cache +0 -1
  158. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/1l/1l4oJ9T6GJ0pN-vGrH1QH9XT7AVF3Z9pakdHrxcsuXw.cache +0 -1
  159. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/9z/9zOsSzS7x1TCGFnvxdjQdrEL2MENRZARP2fzL5JYLF0.cache +0 -1
  160. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/AP/AP7JoF1ZWY1lf5txW64EpzKJEzOIsR9Wkn_V0pl6Kzo.cache +0 -0
  161. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Bu/BuxnmLYpqxwN3qck74Nh3Adaqz5VwdArL7wCZx6TnII.cache +0 -2
  162. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Mn/MnWwrzXFar6jFGAfp8PS_cZXjeFYCA85xsTQT758958.cache +0 -0
  163. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/OM/OM7fRuvTUPQcZERsO6Tsv0fvTdZqsRZbN-mYK00TwnI.cache +0 -1
  164. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Pn/PnNlsrskw8SKHpOLkqJgEN_HjZzB2jsQZauj-dnQQ2A.cache +0 -0
  165. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Rf/RfFWq_tyttbS2wyfSc0kKvcSxUeC_m01sL3Dl6EWEqM.cache +0 -0
  166. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/T-/T-9_ffpUxh6GAYTAzM3sF5lykyt9GVpcbKZaRXxw0wA.cache +0 -2
  167. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Zm/Zmp1hSfJjOVQBTRXZ-xSs8qqIK6lmyQ4GK_uYVsDVJc.cache +0 -1
  168. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/bR/bRSmDUPNI--mMuAgRHWf1r56iydNwHRg_wniS8HqhNg.cache +0 -0
  169. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/dA/dAAcqCClwz0OKgpbEd9G3OUYKW1TeNqJV49Zxh2bQ5A.cache +0 -1
  170. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/dh/dhlLaVScr1-Ty5UFcg6xdU4xSWIuySWzjcC5OU2mOf4.cache +0 -0
  171. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/gt/gtu4KqwPpmom4hwtRz9x180bzJzATR6V8hyE3uHsyas.cache +0 -3
  172. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/kl/klJHIoyRhrimisvwpjAPKxae89riL_0exIgpv4u3u5Y.cache +0 -0
  173. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/m1/m16f5eEXdsOfzbCB88BS3eojIypOTYQjyyv5kkTDwxY.cache +0 -1
  174. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/mm/mmqv3-gEoPWhMrVamMnpI1csCNLKpv-qVQgHERXQNaU.cache +0 -2
  175. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/rp/rpqm2QeVJPWIySovDg4XdCnI6X5_FXCd0pZhuOnwAfk.cache +0 -1
  176. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/wx/wxFkskdA6iSIVZxka368Y8wkP-3edr2nlW4VSOI6GhY.cache +0 -3
  177. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/xP/xPbdGyTHlpGRgIS0gbG9suCByeakXeTFaQ1B_h3_aUI.cache +0 -0
@@ -3,114 +3,136 @@
3
3
  //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
4
4
  //! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic
5
5
 
6
- import moment from '../moment';
6
+ ;(function (global, factory) {
7
+ typeof exports === 'object' && typeof module !== 'undefined'
8
+ && typeof require === 'function' ? factory(require('../moment')) :
9
+ typeof define === 'function' && define.amd ? define(['../moment'], factory) :
10
+ factory(global.moment)
11
+ }(this, (function (moment) { 'use strict';
7
12
 
8
- var translator = {
9
- words: {
10
- //Different grammatical cases
11
- ss: ['секунда', 'секунде', 'секунди'],
12
- m: ['један минут', 'једне минуте'],
13
- mm: ['минут', 'минуте', 'минута'],
14
- h: ['један сат', 'једног сата'],
15
- hh: ['сат', 'сата', 'сати'],
16
- dd: ['дан', 'дана', 'дана'],
17
- MM: ['месец', 'месеца', 'месеци'],
18
- yy: ['година', 'године', 'година'],
19
- },
20
- correctGrammaticalCase: function (number, wordKey) {
21
- return number === 1
22
- ? wordKey[0]
23
- : number >= 2 && number <= 4
24
- ? wordKey[1]
25
- : wordKey[2];
26
- },
27
- translate: function (number, withoutSuffix, key) {
28
- var wordKey = translator.words[key];
29
- if (key.length === 1) {
30
- return withoutSuffix ? wordKey[0] : wordKey[1];
31
- } else {
32
- return (
33
- number +
34
- ' ' +
35
- translator.correctGrammaticalCase(number, wordKey)
36
- );
37
- }
38
- },
39
- };
13
+ //! moment.js locale configuration
40
14
 
41
- export default moment.defineLocale('sr-cyrl', {
42
- months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split(
43
- '_'
44
- ),
45
- monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split(
46
- '_'
47
- ),
48
- monthsParseExact: true,
49
- weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
50
- weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
51
- weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
52
- weekdaysParseExact: true,
53
- longDateFormat: {
54
- LT: 'H:mm',
55
- LTS: 'H:mm:ss',
56
- L: 'D. M. YYYY.',
57
- LL: 'D. MMMM YYYY.',
58
- LLL: 'D. MMMM YYYY. H:mm',
59
- LLLL: 'dddd, D. MMMM YYYY. H:mm',
60
- },
61
- calendar: {
62
- sameDay: '[данас у] LT',
63
- nextDay: '[сутра у] LT',
64
- nextWeek: function () {
65
- switch (this.day()) {
66
- case 0:
67
- return '[у] [недељу] [у] LT';
68
- case 3:
69
- return '[у] [среду] [у] LT';
70
- case 6:
71
- return '[у] [суботу] [у] LT';
72
- case 1:
73
- case 2:
74
- case 4:
75
- case 5:
76
- return '[у] dddd [у] LT';
15
+ var translator = {
16
+ words: {
17
+ //Different grammatical cases
18
+ ss: ['секунда', 'секунде', 'секунди'],
19
+ m: ['један минут', 'једног минута'],
20
+ mm: ['минут', 'минута', 'минута'],
21
+ h: ['један сат', 'једног сата'],
22
+ hh: ['сат', 'сата', 'сати'],
23
+ d: ['један дан', 'једног дана'],
24
+ dd: ['дан', 'дана', 'дана'],
25
+ M: ['један месец', 'једног месеца'],
26
+ MM: ['месец', 'месеца', 'месеци'],
27
+ y: ['једну годину', 'једне године'],
28
+ yy: ['годину', 'године', 'година'],
29
+ },
30
+ correctGrammaticalCase: function (number, wordKey) {
31
+ if (
32
+ number % 10 >= 1 &&
33
+ number % 10 <= 4 &&
34
+ (number % 100 < 10 || number % 100 >= 20)
35
+ ) {
36
+ return number % 10 === 1 ? wordKey[0] : wordKey[1];
77
37
  }
38
+ return wordKey[2];
78
39
  },
79
- lastDay: '[јуче у] LT',
80
- lastWeek: function () {
81
- var lastWeekDays = [
82
- '[прошле] [недеље] [у] LT',
83
- '[прошлог] [понедељка] [у] LT',
84
- '[прошлог] [уторка] [у] LT',
85
- '[прошле] [среде] [у] LT',
86
- '[прошлог] [четвртка] [у] LT',
87
- '[прошлог] [петка] [у] LT',
88
- '[прошле] [суботе] [у] LT',
89
- ];
90
- return lastWeekDays[this.day()];
40
+ translate: function (number, withoutSuffix, key, isFuture) {
41
+ var wordKey = translator.words[key],
42
+ word;
43
+
44
+ if (key.length === 1) {
45
+ // Nominativ
46
+ if (key === 'y' && withoutSuffix) return 'једна година';
47
+ return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];
48
+ }
49
+
50
+ word = translator.correctGrammaticalCase(number, wordKey);
51
+ // Nominativ
52
+ if (key === 'yy' && withoutSuffix && word === 'годину') {
53
+ return number + ' година';
54
+ }
55
+
56
+ return number + ' ' + word;
91
57
  },
92
- sameElse: 'L',
93
- },
94
- relativeTime: {
95
- future: 'за %s',
96
- past: 'пре %s',
97
- s: 'неколико секунди',
98
- ss: translator.translate,
99
- m: translator.translate,
100
- mm: translator.translate,
101
- h: translator.translate,
102
- hh: translator.translate,
103
- d: 'дан',
104
- dd: translator.translate,
105
- M: 'месец',
106
- MM: translator.translate,
107
- y: 'годину',
108
- yy: translator.translate,
109
- },
110
- dayOfMonthOrdinalParse: /\d{1,2}\./,
111
- ordinal: '%d.',
112
- week: {
113
- dow: 1, // Monday is the first day of the week.
114
- doy: 7, // The week that contains Jan 1st is the first week of the year.
115
- },
116
- });
58
+ };
59
+
60
+ var srCyrl = moment.defineLocale('sr-cyrl', {
61
+ months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split(
62
+ '_'
63
+ ),
64
+ monthsShort:
65
+ 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'),
66
+ monthsParseExact: true,
67
+ weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
68
+ weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
69
+ weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
70
+ weekdaysParseExact: true,
71
+ longDateFormat: {
72
+ LT: 'H:mm',
73
+ LTS: 'H:mm:ss',
74
+ L: 'D. M. YYYY.',
75
+ LL: 'D. MMMM YYYY.',
76
+ LLL: 'D. MMMM YYYY. H:mm',
77
+ LLLL: 'dddd, D. MMMM YYYY. H:mm',
78
+ },
79
+ calendar: {
80
+ sameDay: '[данас у] LT',
81
+ nextDay: '[сутра у] LT',
82
+ nextWeek: function () {
83
+ switch (this.day()) {
84
+ case 0:
85
+ return '[у] [недељу] [у] LT';
86
+ case 3:
87
+ return '[у] [среду] [у] LT';
88
+ case 6:
89
+ return '[у] [суботу] [у] LT';
90
+ case 1:
91
+ case 2:
92
+ case 4:
93
+ case 5:
94
+ return '[у] dddd [у] LT';
95
+ }
96
+ },
97
+ lastDay: '[јуче у] LT',
98
+ lastWeek: function () {
99
+ var lastWeekDays = [
100
+ '[прошле] [недеље] [у] LT',
101
+ '[прошлог] [понедељка] [у] LT',
102
+ '[прошлог] [уторка] [у] LT',
103
+ '[прошле] [среде] [у] LT',
104
+ '[прошлог] [четвртка] [у] LT',
105
+ '[прошлог] [петка] [у] LT',
106
+ '[прошле] [суботе] [у] LT',
107
+ ];
108
+ return lastWeekDays[this.day()];
109
+ },
110
+ sameElse: 'L',
111
+ },
112
+ relativeTime: {
113
+ future: 'за %s',
114
+ past: 'пре %s',
115
+ s: 'неколико секунди',
116
+ ss: translator.translate,
117
+ m: translator.translate,
118
+ mm: translator.translate,
119
+ h: translator.translate,
120
+ hh: translator.translate,
121
+ d: translator.translate,
122
+ dd: translator.translate,
123
+ M: translator.translate,
124
+ MM: translator.translate,
125
+ y: translator.translate,
126
+ yy: translator.translate,
127
+ },
128
+ dayOfMonthOrdinalParse: /\d{1,2}\./,
129
+ ordinal: '%d.',
130
+ week: {
131
+ dow: 1, // Monday is the first day of the week.
132
+ doy: 7, // The week that contains Jan 1st is the first week of the year.
133
+ },
134
+ });
135
+
136
+ return srCyrl;
137
+
138
+ })));
@@ -3,116 +3,138 @@
3
3
  //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
4
4
  //! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic
5
5
 
6
- import moment from '../moment';
6
+ ;(function (global, factory) {
7
+ typeof exports === 'object' && typeof module !== 'undefined'
8
+ && typeof require === 'function' ? factory(require('../moment')) :
9
+ typeof define === 'function' && define.amd ? define(['../moment'], factory) :
10
+ factory(global.moment)
11
+ }(this, (function (moment) { 'use strict';
7
12
 
8
- var translator = {
9
- words: {
10
- //Different grammatical cases
11
- ss: ['sekunda', 'sekunde', 'sekundi'],
12
- m: ['jedan minut', 'jedne minute'],
13
- mm: ['minut', 'minute', 'minuta'],
14
- h: ['jedan sat', 'jednog sata'],
15
- hh: ['sat', 'sata', 'sati'],
16
- dd: ['dan', 'dana', 'dana'],
17
- MM: ['mesec', 'meseca', 'meseci'],
18
- yy: ['godina', 'godine', 'godina'],
19
- },
20
- correctGrammaticalCase: function (number, wordKey) {
21
- return number === 1
22
- ? wordKey[0]
23
- : number >= 2 && number <= 4
24
- ? wordKey[1]
25
- : wordKey[2];
26
- },
27
- translate: function (number, withoutSuffix, key) {
28
- var wordKey = translator.words[key];
29
- if (key.length === 1) {
30
- return withoutSuffix ? wordKey[0] : wordKey[1];
31
- } else {
32
- return (
33
- number +
34
- ' ' +
35
- translator.correctGrammaticalCase(number, wordKey)
36
- );
37
- }
38
- },
39
- };
13
+ //! moment.js locale configuration
40
14
 
41
- export default moment.defineLocale('sr', {
42
- months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
43
- '_'
44
- ),
45
- monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
46
- '_'
47
- ),
48
- monthsParseExact: true,
49
- weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(
50
- '_'
51
- ),
52
- weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
53
- weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
54
- weekdaysParseExact: true,
55
- longDateFormat: {
56
- LT: 'H:mm',
57
- LTS: 'H:mm:ss',
58
- L: 'D. M. YYYY.',
59
- LL: 'D. MMMM YYYY.',
60
- LLL: 'D. MMMM YYYY. H:mm',
61
- LLLL: 'dddd, D. MMMM YYYY. H:mm',
62
- },
63
- calendar: {
64
- sameDay: '[danas u] LT',
65
- nextDay: '[sutra u] LT',
66
- nextWeek: function () {
67
- switch (this.day()) {
68
- case 0:
69
- return '[u] [nedelju] [u] LT';
70
- case 3:
71
- return '[u] [sredu] [u] LT';
72
- case 6:
73
- return '[u] [subotu] [u] LT';
74
- case 1:
75
- case 2:
76
- case 4:
77
- case 5:
78
- return '[u] dddd [u] LT';
15
+ var translator = {
16
+ words: {
17
+ //Different grammatical cases
18
+ ss: ['sekunda', 'sekunde', 'sekundi'],
19
+ m: ['jedan minut', 'jednog minuta'],
20
+ mm: ['minut', 'minuta', 'minuta'],
21
+ h: ['jedan sat', 'jednog sata'],
22
+ hh: ['sat', 'sata', 'sati'],
23
+ d: ['jedan dan', 'jednog dana'],
24
+ dd: ['dan', 'dana', 'dana'],
25
+ M: ['jedan mesec', 'jednog meseca'],
26
+ MM: ['mesec', 'meseca', 'meseci'],
27
+ y: ['jednu godinu', 'jedne godine'],
28
+ yy: ['godinu', 'godine', 'godina'],
29
+ },
30
+ correctGrammaticalCase: function (number, wordKey) {
31
+ if (
32
+ number % 10 >= 1 &&
33
+ number % 10 <= 4 &&
34
+ (number % 100 < 10 || number % 100 >= 20)
35
+ ) {
36
+ return number % 10 === 1 ? wordKey[0] : wordKey[1];
79
37
  }
38
+ return wordKey[2];
80
39
  },
81
- lastDay: '[juče u] LT',
82
- lastWeek: function () {
83
- var lastWeekDays = [
84
- '[prošle] [nedelje] [u] LT',
85
- '[prošlog] [ponedeljka] [u] LT',
86
- '[prošlog] [utorka] [u] LT',
87
- '[prošle] [srede] [u] LT',
88
- '[prošlog] [četvrtka] [u] LT',
89
- '[prošlog] [petka] [u] LT',
90
- '[prošle] [subote] [u] LT',
91
- ];
92
- return lastWeekDays[this.day()];
40
+ translate: function (number, withoutSuffix, key, isFuture) {
41
+ var wordKey = translator.words[key],
42
+ word;
43
+
44
+ if (key.length === 1) {
45
+ // Nominativ
46
+ if (key === 'y' && withoutSuffix) return 'jedna godina';
47
+ return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];
48
+ }
49
+
50
+ word = translator.correctGrammaticalCase(number, wordKey);
51
+ // Nominativ
52
+ if (key === 'yy' && withoutSuffix && word === 'godinu') {
53
+ return number + ' godina';
54
+ }
55
+
56
+ return number + ' ' + word;
93
57
  },
94
- sameElse: 'L',
95
- },
96
- relativeTime: {
97
- future: 'za %s',
98
- past: 'pre %s',
99
- s: 'nekoliko sekundi',
100
- ss: translator.translate,
101
- m: translator.translate,
102
- mm: translator.translate,
103
- h: translator.translate,
104
- hh: translator.translate,
105
- d: 'dan',
106
- dd: translator.translate,
107
- M: 'mesec',
108
- MM: translator.translate,
109
- y: 'godinu',
110
- yy: translator.translate,
111
- },
112
- dayOfMonthOrdinalParse: /\d{1,2}\./,
113
- ordinal: '%d.',
114
- week: {
115
- dow: 1, // Monday is the first day of the week.
116
- doy: 7, // The week that contains Jan 7th is the first week of the year.
117
- },
118
- });
58
+ };
59
+
60
+ var sr = moment.defineLocale('sr', {
61
+ months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
62
+ '_'
63
+ ),
64
+ monthsShort:
65
+ 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
66
+ monthsParseExact: true,
67
+ weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(
68
+ '_'
69
+ ),
70
+ weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
71
+ weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
72
+ weekdaysParseExact: true,
73
+ longDateFormat: {
74
+ LT: 'H:mm',
75
+ LTS: 'H:mm:ss',
76
+ L: 'D. M. YYYY.',
77
+ LL: 'D. MMMM YYYY.',
78
+ LLL: 'D. MMMM YYYY. H:mm',
79
+ LLLL: 'dddd, D. MMMM YYYY. H:mm',
80
+ },
81
+ calendar: {
82
+ sameDay: '[danas u] LT',
83
+ nextDay: '[sutra u] LT',
84
+ nextWeek: function () {
85
+ switch (this.day()) {
86
+ case 0:
87
+ return '[u] [nedelju] [u] LT';
88
+ case 3:
89
+ return '[u] [sredu] [u] LT';
90
+ case 6:
91
+ return '[u] [subotu] [u] LT';
92
+ case 1:
93
+ case 2:
94
+ case 4:
95
+ case 5:
96
+ return '[u] dddd [u] LT';
97
+ }
98
+ },
99
+ lastDay: '[juče u] LT',
100
+ lastWeek: function () {
101
+ var lastWeekDays = [
102
+ '[prošle] [nedelje] [u] LT',
103
+ '[prošlog] [ponedeljka] [u] LT',
104
+ '[prošlog] [utorka] [u] LT',
105
+ '[prošle] [srede] [u] LT',
106
+ '[prošlog] [četvrtka] [u] LT',
107
+ '[prošlog] [petka] [u] LT',
108
+ '[prošle] [subote] [u] LT',
109
+ ];
110
+ return lastWeekDays[this.day()];
111
+ },
112
+ sameElse: 'L',
113
+ },
114
+ relativeTime: {
115
+ future: 'za %s',
116
+ past: 'pre %s',
117
+ s: 'nekoliko sekundi',
118
+ ss: translator.translate,
119
+ m: translator.translate,
120
+ mm: translator.translate,
121
+ h: translator.translate,
122
+ hh: translator.translate,
123
+ d: translator.translate,
124
+ dd: translator.translate,
125
+ M: translator.translate,
126
+ MM: translator.translate,
127
+ y: translator.translate,
128
+ yy: translator.translate,
129
+ },
130
+ dayOfMonthOrdinalParse: /\d{1,2}\./,
131
+ ordinal: '%d.',
132
+ week: {
133
+ dow: 1, // Monday is the first day of the week.
134
+ doy: 7, // The week that contains Jan 7th is the first week of the year.
135
+ },
136
+ });
137
+
138
+ return sr;
139
+
140
+ })));