index.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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: ['M.A', 'M.'],
  10. abbreviated: ['M.A', 'M.'],
  11. wide: ['Miloddan Avvalgi', 'Milodiy']
  12. };
  13. var quarterValues = {
  14. narrow: ['1', '2', '3', '4'],
  15. abbreviated: ['CH.1', 'CH.2', 'CH.3', 'CH.4'],
  16. wide: ['1-chi chorak', '2-chi chorak', '3-chi chorak', '4-chi chorak'] // 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: ['Y', 'F', 'M', 'A', 'M', 'I', 'I', 'A', 'S', 'O', 'N', 'D'],
  23. abbreviated: ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'Iyun', 'Iyul', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek'],
  24. wide: ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'Avgust', 'Sentabr', 'Oktabr', 'Noyabr', 'Dekabr']
  25. };
  26. var dayValues = {
  27. narrow: ['Y', 'D', 'S', 'CH', 'P', 'J', 'SH'],
  28. short: ['Ya', 'Du', 'Se', 'Cho', 'Pa', 'Ju', 'Sha'],
  29. abbreviated: ['Yak', 'Dush', 'Sesh', 'Chor', 'Pay', 'Jum', 'Shan'],
  30. wide: ['Yakshanba', 'Dushanba', 'Seshanba', 'Chorshanba', 'Payshanba', 'Juma', 'Shanba']
  31. };
  32. var dayPeriodValues = {
  33. narrow: {
  34. am: 'a',
  35. pm: 'p',
  36. midnight: 'y.t',
  37. noon: 'p.',
  38. morning: 'ertalab',
  39. afternoon: 'tushdan keyin',
  40. evening: 'kechqurun',
  41. night: 'tun'
  42. },
  43. abbreviated: {
  44. am: 'AM',
  45. pm: 'PM',
  46. midnight: 'yarim tun',
  47. noon: 'peshin',
  48. morning: 'ertalab',
  49. afternoon: 'tushdan keyin',
  50. evening: 'kechqurun',
  51. night: 'tun'
  52. },
  53. wide: {
  54. am: 'a.m.',
  55. pm: 'p.m.',
  56. midnight: 'yarim tun',
  57. noon: 'peshin',
  58. morning: 'ertalab',
  59. afternoon: 'tushdan keyin',
  60. evening: 'kechqurun',
  61. night: 'tun'
  62. }
  63. };
  64. var formattingDayPeriodValues = {
  65. narrow: {
  66. am: 'a',
  67. pm: 'p',
  68. midnight: 'y.t',
  69. noon: 'p.',
  70. morning: 'ertalab',
  71. afternoon: 'tushdan keyin',
  72. evening: 'kechqurun',
  73. night: 'tun'
  74. },
  75. abbreviated: {
  76. am: 'AM',
  77. pm: 'PM',
  78. midnight: 'yarim tun',
  79. noon: 'peshin',
  80. morning: 'ertalab',
  81. afternoon: 'tushdan keyin',
  82. evening: 'kechqurun',
  83. night: 'tun'
  84. },
  85. wide: {
  86. am: 'a.m.',
  87. pm: 'p.m.',
  88. midnight: 'yarim tun',
  89. noon: 'peshin',
  90. morning: 'ertalab',
  91. afternoon: 'tushdan keyin',
  92. evening: 'kechqurun',
  93. night: 'tun'
  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. return number;
  107. }
  108. var localize = {
  109. ordinalNumber: ordinalNumber,
  110. era: (0, _index.default)({
  111. values: eraValues,
  112. defaultWidth: 'wide'
  113. }),
  114. quarter: (0, _index.default)({
  115. values: quarterValues,
  116. defaultWidth: 'wide',
  117. argumentCallback: function (quarter) {
  118. return Number(quarter) - 1;
  119. }
  120. }),
  121. month: (0, _index.default)({
  122. values: monthValues,
  123. defaultWidth: 'wide'
  124. }),
  125. day: (0, _index.default)({
  126. values: dayValues,
  127. defaultWidth: 'wide'
  128. }),
  129. dayPeriod: (0, _index.default)({
  130. values: dayPeriodValues,
  131. defaultWidth: 'wide',
  132. formattingValues: formattingDayPeriodValues,
  133. defaultFormattingWidth: 'wide'
  134. })
  135. };
  136. var _default = localize;
  137. exports.default = _default;
  138. module.exports = exports.default;