You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gcgj-dify-1.7.0/node_modules/date-fns/locale/ru/_lib/localize.js

211 lines
4.2 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
const eraValues = {
narrow: ["до н.э.", "н.э."],
abbreviated: ["до н. э.", "н. э."],
wide: ["до нашей эры", "нашей эры"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-й кв.", "2-й кв.", "3-й кв.", "4-й кв."],
wide: ["1-й квартал", "2-й квартал", "3-й квартал", "4-й квартал"],
};
const monthValues = {
narrow: ["Я", "Ф", "М", "А", "М", "И", "И", "А", "С", "О", "Н", "Д"],
abbreviated: [
"янв.",
"фев.",
"март",
"апр.",
"май",
"июнь",
"июль",
"авг.",
"сент.",
"окт.",
"нояб.",
"дек.",
],
wide: [
"январь",
"февраль",
"март",
"апрель",
"май",
"июнь",
"июль",
"август",
"сентябрь",
"октябрь",
"ноябрь",
"декабрь",
],
};
const formattingMonthValues = {
narrow: ["Я", "Ф", "М", "А", "М", "И", "И", "А", "С", "О", "Н", "Д"],
abbreviated: [
"янв.",
"фев.",
"мар.",
"апр.",
"мая",
"июн.",
"июл.",
"авг.",
"сент.",
"окт.",
"нояб.",
"дек.",
],
wide: [
"января",
"февраля",
"марта",
"апреля",
"мая",
"июня",
"июля",
"августа",
"сентября",
"октября",
"ноября",
"декабря",
],
};
const dayValues = {
narrow: ["В", "П", "В", "С", "Ч", "П", "С"],
short: ["вс", "пн", "вт", "ср", "чт", "пт", "сб"],
abbreviated: ["вск", "пнд", "втр", "срд", "чтв", "птн", "суб"],
wide: [
"воскресенье",
"понедельник",
"вторник",
"среда",
"четверг",
"пятница",
"суббота",
],
};
const 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: "ночь",
},
};
const 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: "ночи",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = options?.unit;
let suffix;
if (unit === "date") {
suffix = "-е";
} else if (unit === "week" || unit === "minute" || unit === "second") {
suffix = "-я";
} else {
suffix = "-й";
}
return number + suffix;
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "any",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};