index.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. "use strict";
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
  3. Object.defineProperty(exports, "__esModule", {
  4. value: true
  5. });
  6. exports.default = void 0;
  7. var _index = _interopRequireDefault(require("../../../_lib/buildLocalizeFn/index.js"));
  8. var eraValues = {
  9. narrow: ['BC', 'AD'],
  10. abbreviated: ['BC', 'AD'],
  11. wide: ['기원전', '서기']
  12. };
  13. var quarterValues = {
  14. narrow: ['1', '2', '3', '4'],
  15. abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
  16. wide: ['1분기', '2분기', '3분기', '4분기']
  17. };
  18. var monthValues = {
  19. narrow: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  20. abbreviated: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
  21. wide: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']
  22. };
  23. var dayValues = {
  24. narrow: ['일', '월', '화', '수', '목', '금', '토'],
  25. short: ['일', '월', '화', '수', '목', '금', '토'],
  26. abbreviated: ['일', '월', '화', '수', '목', '금', '토'],
  27. wide: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일']
  28. };
  29. var dayPeriodValues = {
  30. narrow: {
  31. am: '오전',
  32. pm: '오후',
  33. midnight: '자정',
  34. noon: '정오',
  35. morning: '아침',
  36. afternoon: '오후',
  37. evening: '저녁',
  38. night: '밤'
  39. },
  40. abbreviated: {
  41. am: '오전',
  42. pm: '오후',
  43. midnight: '자정',
  44. noon: '정오',
  45. morning: '아침',
  46. afternoon: '오후',
  47. evening: '저녁',
  48. night: '밤'
  49. },
  50. wide: {
  51. am: '오전',
  52. pm: '오후',
  53. midnight: '자정',
  54. noon: '정오',
  55. morning: '아침',
  56. afternoon: '오후',
  57. evening: '저녁',
  58. night: '밤'
  59. }
  60. };
  61. var formattingDayPeriodValues = {
  62. narrow: {
  63. am: '오전',
  64. pm: '오후',
  65. midnight: '자정',
  66. noon: '정오',
  67. morning: '아침',
  68. afternoon: '오후',
  69. evening: '저녁',
  70. night: '밤'
  71. },
  72. abbreviated: {
  73. am: '오전',
  74. pm: '오후',
  75. midnight: '자정',
  76. noon: '정오',
  77. morning: '아침',
  78. afternoon: '오후',
  79. evening: '저녁',
  80. night: '밤'
  81. },
  82. wide: {
  83. am: '오전',
  84. pm: '오후',
  85. midnight: '자정',
  86. noon: '정오',
  87. morning: '아침',
  88. afternoon: '오후',
  89. evening: '저녁',
  90. night: '밤'
  91. }
  92. };
  93. var ordinalNumber = function ordinalNumber(dirtyNumber, options) {
  94. var number = Number(dirtyNumber);
  95. var unit = String(options === null || options === void 0 ? void 0 : options.unit);
  96. switch (unit) {
  97. case 'minute':
  98. case 'second':
  99. return String(number);
  100. case 'date':
  101. return number + '일';
  102. default:
  103. return number + '번째';
  104. }
  105. };
  106. var localize = {
  107. ordinalNumber: ordinalNumber,
  108. era: (0, _index.default)({
  109. values: eraValues,
  110. defaultWidth: 'wide'
  111. }),
  112. quarter: (0, _index.default)({
  113. values: quarterValues,
  114. defaultWidth: 'wide',
  115. argumentCallback: function argumentCallback(quarter) {
  116. return quarter - 1;
  117. }
  118. }),
  119. month: (0, _index.default)({
  120. values: monthValues,
  121. defaultWidth: 'wide'
  122. }),
  123. day: (0, _index.default)({
  124. values: dayValues,
  125. defaultWidth: 'wide'
  126. }),
  127. dayPeriod: (0, _index.default)({
  128. values: dayPeriodValues,
  129. defaultWidth: 'wide',
  130. formattingValues: formattingDayPeriodValues,
  131. defaultFormattingWidth: 'wide'
  132. })
  133. };
  134. var _default = localize;
  135. exports.default = _default;
  136. module.exports = exports.default;