main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
import type { FormatDistanceFn } from "../../types.js";
export declare const formatDistance: FormatDistanceFn;

View File

@@ -0,0 +1,2 @@
import type { FormatDistanceFn } from "../../types.js";
export declare const formatDistance: FormatDistanceFn;

105
node_modules/date-fns/locale/bg/_lib/formatDistance.js generated vendored Normal file
View File

@@ -0,0 +1,105 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: {
one: "по-малко от секунда",
other: "по-малко от {{count}} секунди",
},
xSeconds: {
one: "1 секунда",
other: "{{count}} секунди",
},
halfAMinute: "половин минута",
lessThanXMinutes: {
one: "по-малко от минута",
other: "по-малко от {{count}} минути",
},
xMinutes: {
one: "1 минута",
other: "{{count}} минути",
},
aboutXHours: {
one: "около час",
other: "около {{count}} часа",
},
xHours: {
one: "1 час",
other: "{{count}} часа",
},
xDays: {
one: "1 ден",
other: "{{count}} дни",
},
aboutXWeeks: {
one: "около седмица",
other: "около {{count}} седмици",
},
xWeeks: {
one: "1 седмица",
other: "{{count}} седмици",
},
aboutXMonths: {
one: "около месец",
other: "около {{count}} месеца",
},
xMonths: {
one: "1 месец",
other: "{{count}} месеца",
},
aboutXYears: {
one: "около година",
other: "около {{count}} години",
},
xYears: {
one: "1 година",
other: "{{count}} години",
},
overXYears: {
one: "над година",
other: "над {{count}} години",
},
almostXYears: {
one: "почти година",
other: "почти {{count}} години",
},
};
const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "след " + result;
} else {
return "преди " + result;
}
}
return result;
};
exports.formatDistance = formatDistance;

101
node_modules/date-fns/locale/bg/_lib/formatDistance.mjs generated vendored Normal file
View File

@@ -0,0 +1,101 @@
const formatDistanceLocale = {
lessThanXSeconds: {
one: "по-малко от секунда",
other: "по-малко от {{count}} секунди",
},
xSeconds: {
one: "1 секунда",
other: "{{count}} секунди",
},
halfAMinute: "половин минута",
lessThanXMinutes: {
one: "по-малко от минута",
other: "по-малко от {{count}} минути",
},
xMinutes: {
one: "1 минута",
other: "{{count}} минути",
},
aboutXHours: {
one: "около час",
other: "около {{count}} часа",
},
xHours: {
one: "1 час",
other: "{{count}} часа",
},
xDays: {
one: "1 ден",
other: "{{count}} дни",
},
aboutXWeeks: {
one: "около седмица",
other: "около {{count}} седмици",
},
xWeeks: {
one: "1 седмица",
other: "{{count}} седмици",
},
aboutXMonths: {
one: "около месец",
other: "около {{count}} месеца",
},
xMonths: {
one: "1 месец",
other: "{{count}} месеца",
},
aboutXYears: {
one: "около година",
other: "около {{count}} години",
},
xYears: {
one: "1 година",
other: "{{count}} години",
},
overXYears: {
one: "над година",
other: "над {{count}} години",
},
almostXYears: {
one: "почти година",
other: "почти {{count}} години",
},
};
export const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "след " + result;
} else {
return "преди " + result;
}
}
return result;
};

View File

@@ -0,0 +1,2 @@
import type { FormatLong } from "../../types.js";
export declare const formatLong: FormatLong;

2
node_modules/date-fns/locale/bg/_lib/formatLong.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { FormatLong } from "../../types.js";
export declare const formatLong: FormatLong;

38
node_modules/date-fns/locale/bg/_lib/formatLong.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.js");
const dateFormats = {
full: "EEEE, dd MMMM yyyy",
long: "dd MMMM yyyy",
medium: "dd MMM yyyy",
short: "dd/MM/yyyy",
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "H:mm",
};
const dateTimeFormats = {
any: "{{date}} {{time}}",
};
const formatLong = (exports.formatLong = {
date: (0, _index.buildFormatLongFn)({
formats: dateFormats,
defaultWidth: "full",
}),
time: (0, _index.buildFormatLongFn)({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: (0, _index.buildFormatLongFn)({
formats: dateTimeFormats,
defaultWidth: "any",
}),
});

36
node_modules/date-fns/locale/bg/_lib/formatLong.mjs generated vendored Normal file
View File

@@ -0,0 +1,36 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "EEEE, dd MMMM yyyy",
long: "dd MMMM yyyy",
medium: "dd MMM yyyy",
short: "dd/MM/yyyy",
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "H:mm",
};
const dateTimeFormats = {
any: "{{date}} {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "any",
}),
};

View File

@@ -0,0 +1,2 @@
import type { FormatRelativeFn } from "../../types.js";
export declare const formatRelative: FormatRelativeFn;

View File

@@ -0,0 +1,2 @@
import type { FormatRelativeFn } from "../../types.js";
export declare const formatRelative: FormatRelativeFn;

98
node_modules/date-fns/locale/bg/_lib/formatRelative.js generated vendored Normal file
View File

@@ -0,0 +1,98 @@
"use strict";
exports.formatRelative = void 0;
var _index = require("../../../isSameWeek.js");
var _index2 = require("../../../toDate.js");
// Adapted from the `ru` translation
const weekdays = [
"неделя",
"понеделник",
"вторник",
"сряда",
"четвъртък",
"петък",
"събота",
];
function lastWeek(day) {
const weekday = weekdays[day];
switch (day) {
case 0:
case 3:
case 6:
return "'миналата " + weekday + " в' p";
case 1:
case 2:
case 4:
case 5:
return "'миналия " + weekday + " в' p";
}
}
function thisWeek(day) {
const weekday = weekdays[day];
if (day === 2 /* Tue */) {
return "'във " + weekday + " в' p";
} else {
return "'в " + weekday + " в' p";
}
}
function nextWeek(day) {
const weekday = weekdays[day];
switch (day) {
case 0:
case 3:
case 6:
return "'следващата " + weekday + " в' p";
case 1:
case 2:
case 4:
case 5:
return "'следващия " + weekday + " в' p";
}
}
const lastWeekFormatToken = (dirtyDate, baseDate, options) => {
const date = (0, _index2.toDate)(dirtyDate);
const day = date.getDay();
if ((0, _index.isSameWeek)(date, baseDate, options)) {
return thisWeek(day);
} else {
return lastWeek(day);
}
};
const nextWeekFormatToken = (dirtyDate, baseDate, options) => {
const date = (0, _index2.toDate)(dirtyDate);
const day = date.getDay();
if ((0, _index.isSameWeek)(date, baseDate, options)) {
return thisWeek(day);
} else {
return nextWeek(day);
}
};
const formatRelativeLocale = {
lastWeek: lastWeekFormatToken,
yesterday: "'вчера в' p",
today: "'днес в' p",
tomorrow: "'утре в' p",
nextWeek: nextWeekFormatToken,
other: "P",
};
const formatRelative = (token, date, baseDate, options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date, baseDate, options);
}
return format;
};
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,95 @@
import { isSameWeek } from "../../../isSameWeek.mjs";
import { toDate } from "../../../toDate.mjs";
// Adapted from the `ru` translation
const weekdays = [
"неделя",
"понеделник",
"вторник",
"сряда",
"четвъртък",
"петък",
"събота",
];
function lastWeek(day) {
const weekday = weekdays[day];
switch (day) {
case 0:
case 3:
case 6:
return "'миналата " + weekday + " в' p";
case 1:
case 2:
case 4:
case 5:
return "'миналия " + weekday + " в' p";
}
}
function thisWeek(day) {
const weekday = weekdays[day];
if (day === 2 /* Tue */) {
return "'във " + weekday + " в' p";
} else {
return "'в " + weekday + " в' p";
}
}
function nextWeek(day) {
const weekday = weekdays[day];
switch (day) {
case 0:
case 3:
case 6:
return "'следващата " + weekday + " в' p";
case 1:
case 2:
case 4:
case 5:
return "'следващия " + weekday + " в' p";
}
}
const lastWeekFormatToken = (dirtyDate, baseDate, options) => {
const date = toDate(dirtyDate);
const day = date.getDay();
if (isSameWeek(date, baseDate, options)) {
return thisWeek(day);
} else {
return lastWeek(day);
}
};
const nextWeekFormatToken = (dirtyDate, baseDate, options) => {
const date = toDate(dirtyDate);
const day = date.getDay();
if (isSameWeek(date, baseDate, options)) {
return thisWeek(day);
} else {
return nextWeek(day);
}
};
const formatRelativeLocale = {
lastWeek: lastWeekFormatToken,
yesterday: "'вчера в' p",
today: "'днес в' p",
tomorrow: "'утре в' p",
nextWeek: nextWeekFormatToken,
other: "P",
};
export const formatRelative = (token, date, baseDate, options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date, baseDate, options);
}
return format;
};

2
node_modules/date-fns/locale/bg/_lib/localize.d.mts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { Localize } from "../../types.js";
export declare const localize: Localize;

2
node_modules/date-fns/locale/bg/_lib/localize.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { Localize } from "../../types.js";
export declare const localize: Localize;

158
node_modules/date-fns/locale/bg/_lib/localize.js generated vendored Normal file
View File

@@ -0,0 +1,158 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_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 = {
abbreviated: [
"яну",
"фев",
"мар",
"апр",
"май",
"юни",
"юли",
"авг",
"сеп",
"окт",
"ное",
"дек",
],
wide: [
"януари",
"февруари",
"март",
"април",
"май",
"юни",
"юли",
"август",
"септември",
"октомври",
"ноември",
"декември",
],
};
const dayValues = {
narrow: ["Н", "П", "В", "С", "Ч", "П", "С"],
short: ["нд", "пн", "вт", "ср", "чт", "пт", "сб"],
abbreviated: ["нед", "пон", "вто", "сря", "чет", "пет", "съб"],
wide: [
"неделя",
"понеделник",
"вторник",
"сряда",
"четвъртък",
"петък",
"събота",
],
};
const dayPeriodValues = {
wide: {
am: "преди обяд",
pm: "след обяд",
midnight: "в полунощ",
noon: "на обяд",
morning: "сутринта",
afternoon: "следобед",
evening: "вечерта",
night: "през нощта",
},
};
function isFeminine(unit) {
return (
unit === "year" || unit === "week" || unit === "minute" || unit === "second"
);
}
function isNeuter(unit) {
return unit === "quarter";
}
function numberWithSuffix(number, unit, masculine, feminine, neuter) {
const suffix = isNeuter(unit)
? neuter
: isFeminine(unit)
? feminine
: masculine;
return number + "-" + suffix;
}
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = options?.unit;
if (number === 0) {
return numberWithSuffix(0, unit, "ев", "ева", "ево");
} else if (number % 1000 === 0) {
return numberWithSuffix(number, unit, "ен", "на", "но");
} else if (number % 100 === 0) {
return numberWithSuffix(number, unit, "тен", "тна", "тно");
}
const rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return numberWithSuffix(number, unit, "ви", "ва", "во");
case 2:
return numberWithSuffix(number, unit, "ри", "ра", "ро");
case 7:
case 8:
return numberWithSuffix(number, unit, "ми", "ма", "мо");
}
}
return numberWithSuffix(number, unit, "ти", "та", "то");
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
}),
});

156
node_modules/date-fns/locale/bg/_lib/localize.mjs generated vendored Normal file
View File

@@ -0,0 +1,156 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["пр.н.е.", "н.е."],
abbreviated: ["преди н. е.", "н. е."],
wide: ["преди новата ера", "новата ера"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-во тримес.", "2-ро тримес.", "3-то тримес.", "4-то тримес."],
wide: [
"1-во тримесечие",
"2-ро тримесечие",
"3-то тримесечие",
"4-то тримесечие",
],
};
const monthValues = {
abbreviated: [
"яну",
"фев",
"мар",
"апр",
"май",
"юни",
"юли",
"авг",
"сеп",
"окт",
"ное",
"дек",
],
wide: [
"януари",
"февруари",
"март",
"април",
"май",
"юни",
"юли",
"август",
"септември",
"октомври",
"ноември",
"декември",
],
};
const dayValues = {
narrow: ["Н", "П", "В", "С", "Ч", "П", "С"],
short: ["нд", "пн", "вт", "ср", "чт", "пт", "сб"],
abbreviated: ["нед", "пон", "вто", "сря", "чет", "пет", "съб"],
wide: [
"неделя",
"понеделник",
"вторник",
"сряда",
"четвъртък",
"петък",
"събота",
],
};
const dayPeriodValues = {
wide: {
am: "преди обяд",
pm: "след обяд",
midnight: "в полунощ",
noon: "на обяд",
morning: "сутринта",
afternoon: "следобед",
evening: "вечерта",
night: "през нощта",
},
};
function isFeminine(unit) {
return (
unit === "year" || unit === "week" || unit === "minute" || unit === "second"
);
}
function isNeuter(unit) {
return unit === "quarter";
}
function numberWithSuffix(number, unit, masculine, feminine, neuter) {
const suffix = isNeuter(unit)
? neuter
: isFeminine(unit)
? feminine
: masculine;
return number + "-" + suffix;
}
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = options?.unit;
if (number === 0) {
return numberWithSuffix(0, unit, "ев", "ева", "ево");
} else if (number % 1000 === 0) {
return numberWithSuffix(number, unit, "ен", "на", "но");
} else if (number % 100 === 0) {
return numberWithSuffix(number, unit, "тен", "тна", "тно");
}
const rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return numberWithSuffix(number, unit, "ви", "ва", "во");
case 2:
return numberWithSuffix(number, unit, "ри", "ра", "ро");
case 7:
case 8:
return numberWithSuffix(number, unit, "ми", "ма", "мо");
}
}
return numberWithSuffix(number, unit, "ти", "та", "то");
};
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",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
}),
};

2
node_modules/date-fns/locale/bg/_lib/match.d.mts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { Match } from "../../types.js";
export declare const match: Match;

2
node_modules/date-fns/locale/bg/_lib/match.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { Match } from "../../types.js";
export declare const match: Match;

121
node_modules/date-fns/locale/bg/_lib/match.js generated vendored Normal file
View File

@@ -0,0 +1,121 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern =
/^(\d+)(-?[врмт][аи]|-?т?(ен|на)|-?(ев|ева))?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^((пр)?н\.?\s?е\.?)/i,
abbreviated: /^((пр)?н\.?\s?е\.?)/i,
wide: /^(преди новата ера|новата ера|нова ера)/i,
};
const parseEraPatterns = {
any: [/^п/i, /^н/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234](-?[врт]?o?)? тримес.?/i,
wide: /^[1234](-?[врт]?о?)? тримесечие/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchDayPatterns = {
narrow: /^[нпвсч]/i,
short: /^(нд|пн|вт|ср|чт|пт|сб)/i,
abbreviated: /^(нед|пон|вто|сря|чет|пет|съб)/i,
wide: /^(неделя|понеделник|вторник|сряда|четвъртък|петък|събота)/i,
};
const parseDayPatterns = {
narrow: [/^н/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
any: [/^н[ед]/i, /^п[он]/i, /^вт/i, /^ср/i, /^ч[ет]/i, /^п[ет]/i, /^с[ъб]/i],
};
const matchMonthPatterns = {
abbreviated: /^(яну|фев|мар|апр|май|юни|юли|авг|сеп|окт|ное|дек)/i,
wide: /^(януари|февруари|март|април|май|юни|юли|август|септември|октомври|ноември|декември)/i,
};
const parseMonthPatterns = {
any: [
/^я/i,
/^ф/i,
/^мар/i,
/^ап/i,
/^май/i,
/^юн/i,
/^юл/i,
/^ав/i,
/^се/i,
/^окт/i,
/^но/i,
/^де/i,
],
};
const matchDayPeriodPatterns = {
any: /^(преди о|след о|в по|на о|през|веч|сут|следо)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^преди о/i,
pm: /^след о/i,
midnight: /^в пол/i,
noon: /^на об/i,
morning: /^сут/i,
afternoon: /^следо/i,
evening: /^веч/i,
night: /^през н/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

118
node_modules/date-fns/locale/bg/_lib/match.mjs generated vendored Normal file
View File

@@ -0,0 +1,118 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern =
/^(\d+)(-?[врмт][аи]|-?т?(ен|на)|-?(ев|ева))?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^((пр)?н\.?\s?е\.?)/i,
abbreviated: /^((пр)?н\.?\s?е\.?)/i,
wide: /^(преди новата ера|новата ера|нова ера)/i,
};
const parseEraPatterns = {
any: [/^п/i, /^н/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234](-?[врт]?o?)? тримес.?/i,
wide: /^[1234](-?[врт]?о?)? тримесечие/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchDayPatterns = {
narrow: /^[нпвсч]/i,
short: /^(нд|пн|вт|ср|чт|пт|сб)/i,
abbreviated: /^(нед|пон|вто|сря|чет|пет|съб)/i,
wide: /^(неделя|понеделник|вторник|сряда|четвъртък|петък|събота)/i,
};
const parseDayPatterns = {
narrow: [/^н/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
any: [/^н[ед]/i, /^п[он]/i, /^вт/i, /^ср/i, /^ч[ет]/i, /^п[ет]/i, /^с[ъб]/i],
};
const matchMonthPatterns = {
abbreviated: /^(яну|фев|мар|апр|май|юни|юли|авг|сеп|окт|ное|дек)/i,
wide: /^(януари|февруари|март|април|май|юни|юли|август|септември|октомври|ноември|декември)/i,
};
const parseMonthPatterns = {
any: [
/^я/i,
/^ф/i,
/^мар/i,
/^ап/i,
/^май/i,
/^юн/i,
/^юл/i,
/^ав/i,
/^се/i,
/^окт/i,
/^но/i,
/^де/i,
],
};
const matchDayPeriodPatterns = {
any: /^(преди о|след о|в по|на о|през|веч|сут|следо)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^преди о/i,
pm: /^след о/i,
midnight: /^в пол/i,
noon: /^на об/i,
morning: /^сут/i,
afternoon: /^следо/i,
evening: /^веч/i,
night: /^през н/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};