index.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _index = _interopRequireDefault(require("../../../_lib/buildLocalizeFn/index.js"));
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. var eraValues = {
  9. narrow: ['P', 'M'],
  10. abbreviated: ['PK', 'MK'],
  11. wide: ['Para Krishtit', 'Mbas Krishtit']
  12. };
  13. var quarterValues = {
  14. narrow: ['1', '2', '3', '4'],
  15. abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
  16. wide: ['4-mujori I', '4-mujori II', '4-mujori III', '4-mujori IV'] // Note: in English, the names of days of the week and months are capitalized.
  17. // If you are making a new locale based on this one, check if the same is true for the language you're working on.
  18. // Generally, formatted dates should look like they are in the middle of a sentence,
  19. // e.g. in Spanish language the weekdays and months should be in the lowercase.
  20. };
  21. var monthValues = {
  22. narrow: ['J', 'S', 'M', 'P', 'M', 'Q', 'K', 'G', 'S', 'T', 'N', 'D'],
  23. abbreviated: ['Jan', 'Shk', 'Mar', 'Pri', 'Maj', 'Qer', 'Kor', 'Gus', 'Sht', 'Tet', 'Nën', 'Dhj'],
  24. wide: ['Janar', 'Shkurt', 'Mars', 'Prill', 'Maj', 'Qershor', 'Korrik', 'Gusht', 'Shtator', 'Tetor', 'Nëntor', 'Dhjetor']
  25. };
  26. var dayValues = {
  27. narrow: ['D', 'H', 'M', 'M', 'E', 'P', 'S'],
  28. short: ['Di', 'Hë', 'Ma', 'Më', 'En', 'Pr', 'Sh'],
  29. abbreviated: ['Die', 'Hën', 'Mar', 'Mër', 'Enj', 'Pre', 'Sht'],
  30. wide: ['Dielë', 'Hënë', 'Martë', 'Mërkurë', 'Enjte', 'Premte', 'Shtunë']
  31. };
  32. var dayPeriodValues = {
  33. narrow: {
  34. am: 'p',
  35. pm: 'm',
  36. midnight: 'm',
  37. noon: 'd',
  38. morning: 'mëngjes',
  39. afternoon: 'dite',
  40. evening: 'mbrëmje',
  41. night: 'natë'
  42. },
  43. abbreviated: {
  44. am: 'PD',
  45. pm: 'MD',
  46. midnight: 'mesnëtë',
  47. noon: 'drek',
  48. morning: 'mëngjes',
  49. afternoon: 'mbasdite',
  50. evening: 'mbrëmje',
  51. night: 'natë'
  52. },
  53. wide: {
  54. am: 'p.d.',
  55. pm: 'm.d.',
  56. midnight: 'mesnëtë',
  57. noon: 'drek',
  58. morning: 'mëngjes',
  59. afternoon: 'mbasdite',
  60. evening: 'mbrëmje',
  61. night: 'natë'
  62. }
  63. };
  64. var formattingDayPeriodValues = {
  65. narrow: {
  66. am: 'p',
  67. pm: 'm',
  68. midnight: 'm',
  69. noon: 'd',
  70. morning: 'në mëngjes',
  71. afternoon: 'në mbasdite',
  72. evening: 'në mbrëmje',
  73. night: 'në mesnatë'
  74. },
  75. abbreviated: {
  76. am: 'PD',
  77. pm: 'MD',
  78. midnight: 'mesnatë',
  79. noon: 'drek',
  80. morning: 'në mëngjes',
  81. afternoon: 'në mbasdite',
  82. evening: 'në mbrëmje',
  83. night: 'në mesnatë'
  84. },
  85. wide: {
  86. am: 'p.d.',
  87. pm: 'm.d.',
  88. midnight: 'mesnatë',
  89. noon: 'drek',
  90. morning: 'në mëngjes',
  91. afternoon: 'në mbasdite',
  92. evening: 'në mbrëmje',
  93. night: 'në mesnatë'
  94. }
  95. };
  96. function ordinalNumber(dirtyNumber, _dirtyOptions) {
  97. var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
  98. // if they are different for different grammatical genders,
  99. // use `options.unit`:
  100. //
  101. // var options = dirtyOptions || {}
  102. // var unit = String(options.unit)
  103. //
  104. // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
  105. // 'day', 'hour', 'minute', 'second'
  106. var options = _dirtyOptions || {};
  107. var unit = String(options.unit);
  108. if (unit === 'hour') return number;
  109. if (number === 1) return number + '-rë';
  110. if (number === 4) return number + 't';
  111. return number + '-të';
  112. }
  113. var localize = {
  114. ordinalNumber: ordinalNumber,
  115. era: (0, _index.default)({
  116. values: eraValues,
  117. defaultWidth: 'wide'
  118. }),
  119. quarter: (0, _index.default)({
  120. values: quarterValues,
  121. defaultWidth: 'wide',
  122. argumentCallback: function (quarter) {
  123. return Number(quarter) - 1;
  124. }
  125. }),
  126. month: (0, _index.default)({
  127. values: monthValues,
  128. defaultWidth: 'wide'
  129. }),
  130. day: (0, _index.default)({
  131. values: dayValues,
  132. defaultWidth: 'wide'
  133. }),
  134. dayPeriod: (0, _index.default)({
  135. values: dayPeriodValues,
  136. defaultWidth: 'wide',
  137. formattingValues: formattingDayPeriodValues,
  138. defaultFormattingWidth: 'wide'
  139. })
  140. };
  141. var _default = localize;
  142. exports.default = _default;
  143. module.exports = exports.default;