index.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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: ['av. J.-K', 'ap. J.-K'],
  10. abbreviated: ['av. J.-K', 'ap. J.-K'],
  11. wide: ['anvan Jezi Kris', 'apre Jezi Kris']
  12. };
  13. var quarterValues = {
  14. narrow: ['T1', 'T2', 'T3', 'T4'],
  15. abbreviated: ['1ye trim.', '2yèm trim.', '3yèm trim.', '4yèm trim.'],
  16. wide: ['1ye trimès', '2yèm trimès', '3yèm trimès', '4yèm trimès']
  17. };
  18. var monthValues = {
  19. narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'O', 'S', 'O', 'N', 'D'],
  20. abbreviated: ['janv.', 'fevr.', 'mas', 'avr.', 'me', 'jen', 'jiyè', 'out', 'sept.', 'okt.', 'nov.', 'des.'],
  21. wide: ['janvye', 'fevrye', 'mas', 'avril', 'me', 'jen', 'jiyè', 'out', 'septanm', 'oktòb', 'novanm', 'desanm']
  22. };
  23. var dayValues = {
  24. narrow: ['D', 'L', 'M', 'M', 'J', 'V', 'S'],
  25. short: ['di', 'le', 'ma', 'mè', 'je', 'va', 'sa'],
  26. abbreviated: ['dim.', 'len.', 'mad.', 'mèk.', 'jed.', 'van.', 'sam.'],
  27. wide: ['dimanch', 'lendi', 'madi', 'mèkredi', 'jedi', 'vandredi', 'samdi']
  28. };
  29. var dayPeriodValues = {
  30. narrow: {
  31. am: 'AM',
  32. pm: 'PM',
  33. midnight: 'minwit',
  34. noon: 'midi',
  35. morning: 'mat.',
  36. afternoon: 'ap.m.',
  37. evening: 'swa',
  38. night: 'mat.'
  39. },
  40. abbreviated: {
  41. am: 'AM',
  42. pm: 'PM',
  43. midnight: 'minwit',
  44. noon: 'midi',
  45. morning: 'maten',
  46. afternoon: 'aprèmidi',
  47. evening: 'swa',
  48. night: 'maten'
  49. },
  50. wide: {
  51. am: 'AM',
  52. pm: 'PM',
  53. midnight: 'minwit',
  54. noon: 'midi',
  55. morning: 'nan maten',
  56. afternoon: 'nan aprèmidi',
  57. evening: 'nan aswè',
  58. night: 'nan maten'
  59. }
  60. };
  61. var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
  62. var number = Number(dirtyNumber);
  63. if (number === 0) return String(number);
  64. var suffix = number === 1 ? 'ye' : 'yèm';
  65. return number + suffix;
  66. };
  67. var localize = {
  68. ordinalNumber: ordinalNumber,
  69. era: (0, _index.default)({
  70. values: eraValues,
  71. defaultWidth: 'wide'
  72. }),
  73. quarter: (0, _index.default)({
  74. values: quarterValues,
  75. defaultWidth: 'wide',
  76. argumentCallback: function argumentCallback(quarter) {
  77. return quarter - 1;
  78. }
  79. }),
  80. month: (0, _index.default)({
  81. values: monthValues,
  82. defaultWidth: 'wide'
  83. }),
  84. day: (0, _index.default)({
  85. values: dayValues,
  86. defaultWidth: 'wide'
  87. }),
  88. dayPeriod: (0, _index.default)({
  89. values: dayPeriodValues,
  90. defaultWidth: 'wide'
  91. })
  92. };
  93. var _default = localize;
  94. exports.default = _default;
  95. module.exports = exports.default;