index.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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: ['v.Chr.', 'n.Chr.'],
  10. abbreviated: ['v.Chr.', 'n.Chr.'],
  11. wide: ['vor Christus', 'nach Christus']
  12. };
  13. var quarterValues = {
  14. narrow: ['1', '2', '3', '4'],
  15. abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
  16. wide: ['1. Quartal', '2. Quartal', '3. Quartal', '4. Quartal'] // Note: in German, 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', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
  23. abbreviated: ['Jän', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
  24. wide: ['Jänner', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']
  25. };
  26. var dayValues = {
  27. narrow: ['S', 'M', 'D', 'M', 'D', 'F', 'S'],
  28. short: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
  29. abbreviated: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'],
  30. wide: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'] // https://www.unicode.org/cldr/charts/32/summary/de.html#1881
  31. };
  32. var dayPeriodValues = {
  33. narrow: {
  34. am: 'vm.',
  35. pm: 'nm.',
  36. midnight: 'Mitternacht',
  37. noon: 'Mittag',
  38. morning: 'Morgen',
  39. afternoon: 'Nachm.',
  40. evening: 'Abend',
  41. night: 'Nacht'
  42. },
  43. abbreviated: {
  44. am: 'vorm.',
  45. pm: 'nachm.',
  46. midnight: 'Mitternacht',
  47. noon: 'Mittag',
  48. morning: 'Morgen',
  49. afternoon: 'Nachmittag',
  50. evening: 'Abend',
  51. night: 'Nacht'
  52. },
  53. wide: {
  54. am: 'vormittags',
  55. pm: 'nachmittags',
  56. midnight: 'Mitternacht',
  57. noon: 'Mittag',
  58. morning: 'Morgen',
  59. afternoon: 'Nachmittag',
  60. evening: 'Abend',
  61. night: 'Nacht'
  62. }
  63. };
  64. var formattingDayPeriodValues = {
  65. narrow: {
  66. am: 'vm.',
  67. pm: 'nm.',
  68. midnight: 'Mitternacht',
  69. noon: 'Mittag',
  70. morning: 'morgens',
  71. afternoon: 'nachm.',
  72. evening: 'abends',
  73. night: 'nachts'
  74. },
  75. abbreviated: {
  76. am: 'vorm.',
  77. pm: 'nachm.',
  78. midnight: 'Mitternacht',
  79. noon: 'Mittag',
  80. morning: 'morgens',
  81. afternoon: 'nachmittags',
  82. evening: 'abends',
  83. night: 'nachts'
  84. },
  85. wide: {
  86. am: 'vormittags',
  87. pm: 'nachmittags',
  88. midnight: 'Mitternacht',
  89. noon: 'Mittag',
  90. morning: 'morgens',
  91. afternoon: 'nachmittags',
  92. evening: 'abends',
  93. night: 'nachts'
  94. }
  95. };
  96. function ordinalNumber(dirtyNumber, _dirtyOptions) {
  97. var number = Number(dirtyNumber);
  98. return number + '.';
  99. }
  100. var localize = {
  101. ordinalNumber: ordinalNumber,
  102. era: (0, _index.default)({
  103. values: eraValues,
  104. defaultWidth: 'wide'
  105. }),
  106. quarter: (0, _index.default)({
  107. values: quarterValues,
  108. defaultWidth: 'wide',
  109. argumentCallback: function (quarter) {
  110. return Number(quarter) - 1;
  111. }
  112. }),
  113. month: (0, _index.default)({
  114. values: monthValues,
  115. defaultWidth: 'wide'
  116. }),
  117. day: (0, _index.default)({
  118. values: dayValues,
  119. defaultWidth: 'wide'
  120. }),
  121. dayPeriod: (0, _index.default)({
  122. values: dayPeriodValues,
  123. defaultWidth: 'wide',
  124. formattingValues: formattingDayPeriodValues,
  125. defaultFormattingWidth: 'wide'
  126. })
  127. };
  128. var _default = localize;
  129. exports.default = _default;
  130. module.exports = exports.default;