You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
4.2 KiB

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