hugoWebsite/node_modules/date-fns/locale/bn/_lib/localize/index.js
Jeremy Nusser 0ab675d92b Initial commit... 🎉🎉🎉
2022-10-28 17:20:35 -05:00

215 lines
No EOL
6.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.numberToLocale = numberToLocale;
var _index = _interopRequireDefault(require("../../../_lib/buildLocalizeFn/index.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var numberValues = {
locale: {
'1': 'ā§§',
'2': 'ā§¨',
'3': 'ā§Š',
'4': 'ā§Ē',
'5': 'ā§Ģ',
'6': 'ā§Ŧ',
'7': 'ā§­',
'8': 'ā§Ž',
'9': 'ā§¯',
'0': 'ā§Ļ'
},
number: {
'ā§§': '1',
'ā§¨': '2',
'ā§Š': '3',
'ā§Ē': '4',
'ā§Ģ': '5',
'ā§Ŧ': '6',
'ā§­': '7',
'ā§Ž': '8',
'ā§¯': '9',
'ā§Ļ': '0'
}
};
var eraValues = {
narrow: ['āĻ–ā§āĻ°āĻŋāĻƒāĻĒā§‚āĻƒ', 'āĻ–ā§āĻ°āĻŋāĻƒ'],
abbreviated: ['āĻ–ā§āĻ°āĻŋāĻƒāĻĒā§‚āĻ°ā§āĻŦ', 'āĻ–ā§āĻ°āĻŋāĻƒ'],
wide: ['āĻ–ā§āĻ°āĻŋāĻ¸ā§āĻŸāĻĒā§‚āĻ°ā§āĻŦ', 'āĻ–ā§āĻ°āĻŋāĻ¸ā§āĻŸāĻžāĻŦā§āĻĻ']
};
var quarterValues = {
narrow: ['ā§§', 'ā§¨', 'ā§Š', 'ā§Ē'],
abbreviated: ['ā§§āĻ¤ā§āĻ°ā§ˆ', 'ā§¨āĻ¤ā§āĻ°ā§ˆ', 'ā§ŠāĻ¤ā§āĻ°ā§ˆ', 'ā§ĒāĻ¤ā§āĻ°ā§ˆ'],
wide: ['ā§§āĻŽ āĻ¤ā§āĻ°ā§ˆāĻŽāĻžāĻ¸āĻŋāĻ•', 'ā§¨ā§Ÿ āĻ¤ā§āĻ°ā§ˆāĻŽāĻžāĻ¸āĻŋāĻ•', 'ā§Šā§Ÿ āĻ¤ā§āĻ°ā§ˆāĻŽāĻžāĻ¸āĻŋāĻ•', 'ā§ĒāĻ°ā§āĻĨ āĻ¤ā§āĻ°ā§ˆāĻŽāĻžāĻ¸āĻŋāĻ•']
};
var monthValues = {
narrow: ['āĻœāĻžāĻ¨ā§', 'āĻĢā§‡āĻŦā§āĻ°ā§', 'āĻŽāĻžāĻ°ā§āĻš', 'āĻāĻĒā§āĻ°āĻŋāĻ˛', 'āĻŽā§‡', 'āĻœā§āĻ¨', 'āĻœā§āĻ˛āĻžāĻ‡', 'āĻ†āĻ—āĻ¸ā§āĻŸ', 'āĻ¸ā§‡āĻĒā§āĻŸ', 'āĻ…āĻ•ā§āĻŸā§‹', 'āĻ¨āĻ­ā§‡', 'āĻĄāĻŋāĻ¸ā§‡'],
abbreviated: ['āĻœāĻžāĻ¨ā§', 'āĻĢā§‡āĻŦā§āĻ°ā§', 'āĻŽāĻžāĻ°ā§āĻš', 'āĻāĻĒā§āĻ°āĻŋāĻ˛', 'āĻŽā§‡', 'āĻœā§āĻ¨', 'āĻœā§āĻ˛āĻžāĻ‡', 'āĻ†āĻ—āĻ¸ā§āĻŸ', 'āĻ¸ā§‡āĻĒā§āĻŸ', 'āĻ…āĻ•ā§āĻŸā§‹', 'āĻ¨āĻ­ā§‡', 'āĻĄāĻŋāĻ¸ā§‡'],
wide: ['āĻœāĻžāĻ¨ā§ā§ŸāĻžāĻ°āĻŋ', 'āĻĢā§‡āĻŦā§āĻ°ā§ā§ŸāĻžāĻ°āĻŋ', 'āĻŽāĻžāĻ°ā§āĻš', 'āĻāĻĒā§āĻ°āĻŋāĻ˛', 'āĻŽā§‡', 'āĻœā§āĻ¨', 'āĻœā§āĻ˛āĻžāĻ‡', 'āĻ†āĻ—āĻ¸ā§āĻŸ', 'āĻ¸ā§‡āĻĒā§āĻŸā§‡āĻŽā§āĻŦāĻ°', 'āĻ…āĻ•ā§āĻŸā§‹āĻŦāĻ°', 'āĻ¨āĻ­ā§‡āĻŽā§āĻŦāĻ°', 'āĻĄāĻŋāĻ¸ā§‡āĻŽā§āĻŦāĻ°']
};
var dayValues = {
narrow: ['āĻ°', 'āĻ¸ā§‹', 'āĻŽ', 'āĻŦā§', 'āĻŦā§ƒ', 'āĻļā§', 'āĻļ'],
short: ['āĻ°āĻŦāĻŋ', 'āĻ¸ā§‹āĻŽ', 'āĻŽāĻ™ā§āĻ—āĻ˛', 'āĻŦā§āĻ§', 'āĻŦā§ƒāĻš', 'āĻļā§āĻ•ā§āĻ°', 'āĻļāĻ¨āĻŋ'],
abbreviated: ['āĻ°āĻŦāĻŋ', 'āĻ¸ā§‹āĻŽ', 'āĻŽāĻ™ā§āĻ—āĻ˛', 'āĻŦā§āĻ§', 'āĻŦā§ƒāĻš', 'āĻļā§āĻ•ā§āĻ°', 'āĻļāĻ¨āĻŋ'],
wide: ['āĻ°āĻŦāĻŋāĻŦāĻžāĻ°', 'āĻ¸ā§‹āĻŽāĻŦāĻžāĻ°', 'āĻŽāĻ™ā§āĻ—āĻ˛āĻŦāĻžāĻ°', 'āĻŦā§āĻ§āĻŦāĻžāĻ°', 'āĻŦā§ƒāĻšāĻ¸ā§āĻĒāĻ¤āĻŋāĻŦāĻžāĻ° ', 'āĻļā§āĻ•ā§āĻ°āĻŦāĻžāĻ°', 'āĻļāĻ¨āĻŋāĻŦāĻžāĻ°']
};
var dayPeriodValues = {
narrow: {
am: 'āĻĒā§‚',
pm: 'āĻ…āĻĒ',
midnight: 'āĻŽāĻ§ā§āĻ¯āĻ°āĻžāĻ¤',
noon: 'āĻŽāĻ§ā§āĻ¯āĻžāĻšā§āĻ¨',
morning: 'āĻ¸āĻ•āĻžāĻ˛',
afternoon: 'āĻŦāĻŋāĻ•āĻžāĻ˛',
evening: 'āĻ¸āĻ¨ā§āĻ§ā§āĻ¯āĻž',
night: 'āĻ°āĻžāĻ¤'
},
abbreviated: {
am: 'āĻĒā§‚āĻ°ā§āĻŦāĻžāĻšā§āĻ¨',
pm: 'āĻ…āĻĒāĻ°āĻžāĻšā§āĻ¨',
midnight: 'āĻŽāĻ§ā§āĻ¯āĻ°āĻžāĻ¤',
noon: 'āĻŽāĻ§ā§āĻ¯āĻžāĻšā§āĻ¨',
morning: 'āĻ¸āĻ•āĻžāĻ˛',
afternoon: 'āĻŦāĻŋāĻ•āĻžāĻ˛',
evening: 'āĻ¸āĻ¨ā§āĻ§ā§āĻ¯āĻž',
night: 'āĻ°āĻžāĻ¤'
},
wide: {
am: 'āĻĒā§‚āĻ°ā§āĻŦāĻžāĻšā§āĻ¨',
pm: 'āĻ…āĻĒāĻ°āĻžāĻšā§āĻ¨',
midnight: 'āĻŽāĻ§ā§āĻ¯āĻ°āĻžāĻ¤',
noon: 'āĻŽāĻ§ā§āĻ¯āĻžāĻšā§āĻ¨',
morning: 'āĻ¸āĻ•āĻžāĻ˛',
afternoon: 'āĻŦāĻŋāĻ•āĻžāĻ˛',
evening: 'āĻ¸āĻ¨ā§āĻ§ā§āĻ¯āĻž',
night: 'āĻ°āĻžāĻ¤'
}
};
var formattingDayPeriodValues = {
narrow: {
am: 'āĻĒā§‚',
pm: 'āĻ…āĻĒ',
midnight: 'āĻŽāĻ§ā§āĻ¯āĻ°āĻžāĻ¤',
noon: 'āĻŽāĻ§ā§āĻ¯āĻžāĻšā§āĻ¨',
morning: 'āĻ¸āĻ•āĻžāĻ˛',
afternoon: 'āĻŦāĻŋāĻ•āĻžāĻ˛',
evening: 'āĻ¸āĻ¨ā§āĻ§ā§āĻ¯āĻž',
night: 'āĻ°āĻžāĻ¤'
},
abbreviated: {
am: 'āĻĒā§‚āĻ°ā§āĻŦāĻžāĻšā§āĻ¨',
pm: 'āĻ…āĻĒāĻ°āĻžāĻšā§āĻ¨',
midnight: 'āĻŽāĻ§ā§āĻ¯āĻ°āĻžāĻ¤',
noon: 'āĻŽāĻ§ā§āĻ¯āĻžāĻšā§āĻ¨',
morning: 'āĻ¸āĻ•āĻžāĻ˛',
afternoon: 'āĻŦāĻŋāĻ•āĻžāĻ˛',
evening: 'āĻ¸āĻ¨ā§āĻ§ā§āĻ¯āĻž',
night: 'āĻ°āĻžāĻ¤'
},
wide: {
am: 'āĻĒā§‚āĻ°ā§āĻŦāĻžāĻšā§āĻ¨',
pm: 'āĻ…āĻĒāĻ°āĻžāĻšā§āĻ¨',
midnight: 'āĻŽāĻ§ā§āĻ¯āĻ°āĻžāĻ¤',
noon: 'āĻŽāĻ§ā§āĻ¯āĻžāĻšā§āĻ¨',
morning: 'āĻ¸āĻ•āĻžāĻ˛',
afternoon: 'āĻŦāĻŋāĻ•āĻžāĻ˛',
evening: 'āĻ¸āĻ¨ā§āĻ§ā§āĻ¯āĻž',
night: 'āĻ°āĻžāĻ¤'
}
};
function dateOrdinalNumber(number, localeNumber) {
if (number > 18 && number <= 31) {
return localeNumber + 'āĻļā§‡';
} else {
switch (number) {
case 1:
return localeNumber + 'āĻ˛āĻž';
case 2:
case 3:
return localeNumber + 'āĻ°āĻž';
case 4:
return localeNumber + 'āĻ āĻž';
default:
return localeNumber + 'āĻ‡';
}
}
}
var ordinalNumber = function ordinalNumber(dirtyNumber, options) {
var number = Number(dirtyNumber);
var localeNumber = numberToLocale(number);
var unit = options === null || options === void 0 ? void 0 : options.unit;
if (unit === 'date') {
return dateOrdinalNumber(number, localeNumber);
}
if (number > 10 || number === 0) return localeNumber + 'āĻ¤āĻŽ';
var rem10 = number % 10;
switch (rem10) {
case 2:
case 3:
return localeNumber + 'ā§Ÿ';
case 4:
return localeNumber + 'āĻ°ā§āĻĨ';
case 6:
return localeNumber + 'āĻˇā§āĻ ';
default:
return localeNumber + 'āĻŽ';
}
}; // function localeToNumber(locale: string): number {
// const enNumber = locale.toString().replace(/[ā§§ā§¨ā§Šā§Ēā§Ģā§Ŧā§­ā§Žā§¯ā§Ļ]/g, function (match) {
// return numberValues.number[match as keyof typeof numberValues.number]
// })
// return Number(enNumber)
// }
function numberToLocale(enNumber) {
return enNumber.toString().replace(/\d/g, function (match) {
return numberValues.locale[match];
});
}
var localize = {
ordinalNumber: ordinalNumber,
era: (0, _index.default)({
values: eraValues,
defaultWidth: 'wide'
}),
quarter: (0, _index.default)({
values: quarterValues,
defaultWidth: 'wide',
argumentCallback: function argumentCallback(quarter) {
return quarter - 1;
}
}),
month: (0, _index.default)({
values: monthValues,
defaultWidth: 'wide'
}),
day: (0, _index.default)({
values: dayValues,
defaultWidth: 'wide'
}),
dayPeriod: (0, _index.default)({
values: dayPeriodValues,
defaultWidth: 'wide',
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: 'wide'
})
};
var _default = localize;
exports.default = _default;