me.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //! moment.js locale configuration
  2. //! locale : Montenegrin [me]
  3. //! author : Miodrag Nikač <miodrag@restartit.me> : https://github.com/miodragnikac
  4. ;(function (global, factory) {
  5. typeof exports === 'object' && typeof module !== 'undefined'
  6. && typeof require === 'function' ? factory(require('../moment')) :
  7. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  8. factory(global.moment)
  9. }(this, (function (moment) { 'use strict';
  10. var translator = {
  11. words: { //Different grammatical cases
  12. ss: ['sekund', 'sekunda', 'sekundi'],
  13. m: ['jedan minut', 'jednog minuta'],
  14. mm: ['minut', 'minuta', 'minuta'],
  15. h: ['jedan sat', 'jednog sata'],
  16. hh: ['sat', 'sata', 'sati'],
  17. dd: ['dan', 'dana', 'dana'],
  18. MM: ['mjesec', 'mjeseca', 'mjeseci'],
  19. yy: ['godina', 'godine', 'godina']
  20. },
  21. correctGrammaticalCase: function (number, wordKey) {
  22. return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
  23. },
  24. translate: function (number, withoutSuffix, key) {
  25. var wordKey = translator.words[key];
  26. if (key.length === 1) {
  27. return withoutSuffix ? wordKey[0] : wordKey[1];
  28. } else {
  29. return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
  30. }
  31. }
  32. };
  33. var me = moment.defineLocale('me', {
  34. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
  35. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
  36. monthsParseExact : true,
  37. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
  38. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  39. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  40. weekdaysParseExact : true,
  41. longDateFormat: {
  42. LT: 'H:mm',
  43. LTS : 'H:mm:ss',
  44. L: 'DD.MM.YYYY',
  45. LL: 'D. MMMM YYYY',
  46. LLL: 'D. MMMM YYYY H:mm',
  47. LLLL: 'dddd, D. MMMM YYYY H:mm'
  48. },
  49. calendar: {
  50. sameDay: '[danas u] LT',
  51. nextDay: '[sjutra u] LT',
  52. nextWeek: function () {
  53. switch (this.day()) {
  54. case 0:
  55. return '[u] [nedjelju] [u] LT';
  56. case 3:
  57. return '[u] [srijedu] [u] LT';
  58. case 6:
  59. return '[u] [subotu] [u] LT';
  60. case 1:
  61. case 2:
  62. case 4:
  63. case 5:
  64. return '[u] dddd [u] LT';
  65. }
  66. },
  67. lastDay : '[juče u] LT',
  68. lastWeek : function () {
  69. var lastWeekDays = [
  70. '[prošle] [nedjelje] [u] LT',
  71. '[prošlog] [ponedjeljka] [u] LT',
  72. '[prošlog] [utorka] [u] LT',
  73. '[prošle] [srijede] [u] LT',
  74. '[prošlog] [četvrtka] [u] LT',
  75. '[prošlog] [petka] [u] LT',
  76. '[prošle] [subote] [u] LT'
  77. ];
  78. return lastWeekDays[this.day()];
  79. },
  80. sameElse : 'L'
  81. },
  82. relativeTime : {
  83. future : 'za %s',
  84. past : 'prije %s',
  85. s : 'nekoliko sekundi',
  86. ss : translator.translate,
  87. m : translator.translate,
  88. mm : translator.translate,
  89. h : translator.translate,
  90. hh : translator.translate,
  91. d : 'dan',
  92. dd : translator.translate,
  93. M : 'mjesec',
  94. MM : translator.translate,
  95. y : 'godinu',
  96. yy : translator.translate
  97. },
  98. dayOfMonthOrdinalParse: /\d{1,2}\./,
  99. ordinal : '%d.',
  100. week : {
  101. dow : 1, // Monday is the first day of the week.
  102. doy : 7 // The week that contains Jan 1st is the first week of the year.
  103. }
  104. });
  105. return me;
  106. })));