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;

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

@@ -0,0 +1,42 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: "តិចជាង {{count}} វិនាទី",
xSeconds: "{{count}} វិនាទី",
halfAMinute: "កន្លះនាទី",
lessThanXMinutes: "តិចជាង {{count}} នាទី",
xMinutes: "{{count}} នាទី",
aboutXHours: "ប្រហែល {{count}} ម៉ោង",
xHours: "{{count}} ម៉ោង",
xDays: "{{count}} ថ្ងៃ",
aboutXWeeks: "ប្រហែល {{count}} សប្តាហ៍",
xWeeks: "{{count}} សប្តាហ៍",
aboutXMonths: "ប្រហែល {{count}} ខែ",
xMonths: "{{count}} ខែ",
aboutXYears: "ប្រហែល {{count}} ឆ្នាំ",
xYears: "{{count}} ឆ្នាំ",
overXYears: "ជាង {{count}} ឆ្នាំ",
almostXYears: "ជិត {{count}} ឆ្នាំ",
};
const formatDistance = (token, count, options) => {
const tokenValue = formatDistanceLocale[token];
let result = tokenValue;
if (typeof count === "number") {
result = result.replace("{{count}}", count.toString());
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "ក្នុងរយៈពេល " + result;
} else {
return result + "មុន";
}
}
return result;
};
exports.formatDistance = formatDistance;

View File

@@ -0,0 +1,38 @@
const formatDistanceLocale = {
lessThanXSeconds: "តិចជាង {{count}} វិនាទី",
xSeconds: "{{count}} វិនាទី",
halfAMinute: "កន្លះនាទី",
lessThanXMinutes: "តិចជាង {{count}} នាទី",
xMinutes: "{{count}} នាទី",
aboutXHours: "ប្រហែល {{count}} ម៉ោង",
xHours: "{{count}} ម៉ោង",
xDays: "{{count}} ថ្ងៃ",
aboutXWeeks: "ប្រហែល {{count}} សប្តាហ៍",
xWeeks: "{{count}} សប្តាហ៍",
aboutXMonths: "ប្រហែល {{count}} ខែ",
xMonths: "{{count}} ខែ",
aboutXYears: "ប្រហែល {{count}} ឆ្នាំ",
xYears: "{{count}} ឆ្នាំ",
overXYears: "ជាង {{count}} ឆ្នាំ",
almostXYears: "ជិត {{count}} ឆ្នាំ",
};
export const formatDistance = (token, count, options) => {
const tokenValue = formatDistanceLocale[token];
let result = tokenValue;
if (typeof count === "number") {
result = result.replace("{{count}}", count.toString());
}
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/km/_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;

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

@@ -0,0 +1,41 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.js");
const dateFormats = {
full: "EEEE do MMMM y",
long: "do MMMM y",
medium: "d MMM y",
short: "dd/MM/yyyy",
};
const timeFormats = {
full: "h:mm:ss a",
long: "h:mm:ss a",
medium: "h:mm:ss a",
short: "h:mm a",
};
const dateTimeFormats = {
full: "{{date}} 'ម៉ោង' {{time}}",
long: "{{date}} 'ម៉ោង' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{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: "full",
}),
});

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

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "EEEE do MMMM y",
long: "do MMMM y",
medium: "d MMM y",
short: "dd/MM/yyyy",
};
const timeFormats = {
full: "h:mm:ss a",
long: "h:mm:ss a",
medium: "h:mm:ss a",
short: "h:mm a",
};
const dateTimeFormats = {
full: "{{date}} 'ម៉ោង' {{time}}",
long: "{{date}} 'ម៉ោង' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};

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;

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

@@ -0,0 +1,15 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "'ថ្ងៃ'eeee'ស​ប្តា​ហ៍​មុនម៉ោង' p",
yesterday: "'ម្សិលមិញនៅម៉ោង' p",
today: "'ថ្ងៃនេះម៉ោង' p",
tomorrow: "'ថ្ងៃស្អែកម៉ោង' p",
nextWeek: "'ថ្ងៃ'eeee'ស​ប្តា​ហ៍​ក្រោយម៉ោង' p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,11 @@
const formatRelativeLocale = {
lastWeek: "'ថ្ងៃ'eeee'ស​ប្តា​ហ៍​មុនម៉ោង' p",
yesterday: "'ម្សិលមិញនៅម៉ោង' p",
today: "'ថ្ងៃនេះម៉ោង' p",
tomorrow: "'ថ្ងៃស្អែកម៉ោង' p",
nextWeek: "'ថ្ងៃ'eeee'ស​ប្តា​ហ៍​ក្រោយម៉ោង' p",
other: "P",
};
export const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];

2
node_modules/date-fns/locale/km/_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/km/_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;

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

@@ -0,0 +1,172 @@
"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: ["Q1", "Q2", "Q3", "Q4"],
wide: ["ត្រីមាសទី 1", "ត្រីមាសទី 2", "ត្រីមាសទី 3", "ត្រីមាសទី 4"],
};
const monthValues = {
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, _) => {
const number = Number(dirtyNumber);
return number.toString();
};
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",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

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

@@ -0,0 +1,170 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["ម.គស", "គស"],
abbreviated: ["មុនគ.ស", "គ.ស"],
wide: ["មុនគ្រិស្តសករាជ", "នៃគ្រិស្តសករាជ"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["ត្រីមាសទី 1", "ត្រីមាសទី 2", "ត្រីមាសទី 3", "ត្រីមាសទី 4"],
};
const monthValues = {
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, _) => {
const number = Number(dirtyNumber);
return number.toString();
};
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",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

2
node_modules/date-fns/locale/km/_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/km/_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;

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

@@ -0,0 +1,140 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ម\.)?គស/i,
abbreviated: /^(មុន)?គ\.ស/i,
wide: /^(មុន|នៃ)គ្រិស្តសករាជ/i,
};
const parseEraPatterns = {
any: [/^(ម|មុន)គ\.?ស/i, /^(នៃ)?គ\.?ស/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^(ត្រីមាស)(ទី)?\s?[1234]/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^(ម\.ក|ក\.ម|មិ|ម\.ស|ឧ\.ស|ម\.ថ|ក\.ដ|សី|កញ|តុ|វិ|ធ)/i,
abbreviated:
/^(មករា|កុម្ភៈ|មីនា|មេសា|ឧសភា|មិថុនា|កក្កដា|សីហា|កញ្ញា|តុលា|វិច្ឆិកា|ធ្នូ)/i,
wide: /^(មករា|កុម្ភៈ|មីនា|មេសា|ឧសភា|មិថុនា|កក្កដា|សីហា|កញ្ញា|តុលា|វិច្ឆិកា|ធ្នូ)/i,
};
const parseMonthPatterns = {
narrow: [
/^ម\.ក/i,
/^ក\.ម/i,
/^មិ/i,
/^ម\.ស/i,
/^ឧ\.ស/i,
/^ម\.ថ/i,
/^ក\.ដ/i,
/^សី/i,
/^កញ/i,
/^តុ/i,
/^វិ/i,
/^ធ/i,
],
any: [
/^មក/i,
/^កុ/i,
/^មីន/i,
/^មេ/i,
/^ឧស/i,
/^មិថ/i,
/^កក/i,
/^សី/i,
/^កញ/i,
/^តុ/i,
/^វិច/i,
/^ធ/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 matchDayPeriodPatterns = {
narrow:
/^(ព្រឹក|ល្ងាច|ពេលព្រឹក|ពេលថ្ងៃត្រង់|ពេលល្ងាច|ពេលរសៀល|ពេលយប់|ពេលកណ្ដាលអធ្រាត្រ)/i,
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: function (value) {
return 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",
}),
});

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

@@ -0,0 +1,137 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ម\.)?គស/i,
abbreviated: /^(មុន)?គ\.ស/i,
wide: /^(មុន|នៃ)គ្រិស្តសករាជ/i,
};
const parseEraPatterns = {
any: [/^(ម|មុន)គ\.?ស/i, /^(នៃ)?គ\.?ស/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^(ត្រីមាស)(ទី)?\s?[1234]/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^(ម\.ក|ក\.ម|មិ|ម\.ស|ឧ\.ស|ម\.ថ|ក\.ដ|សី|កញ|តុ|វិ|ធ)/i,
abbreviated:
/^(មករា|កុម្ភៈ|មីនា|មេសា|ឧសភា|មិថុនា|កក្កដា|សីហា|កញ្ញា|តុលា|វិច្ឆិកា|ធ្នូ)/i,
wide: /^(មករា|កុម្ភៈ|មីនា|មេសា|ឧសភា|មិថុនា|កក្កដា|សីហា|កញ្ញា|តុលា|វិច្ឆិកា|ធ្នូ)/i,
};
const parseMonthPatterns = {
narrow: [
/^ម\.ក/i,
/^ក\.ម/i,
/^មិ/i,
/^ម\.ស/i,
/^ឧ\.ស/i,
/^ម\.ថ/i,
/^ក\.ដ/i,
/^សី/i,
/^កញ/i,
/^តុ/i,
/^វិ/i,
/^ធ/i,
],
any: [
/^មក/i,
/^កុ/i,
/^មីន/i,
/^មេ/i,
/^ឧស/i,
/^មិថ/i,
/^កក/i,
/^សី/i,
/^កញ/i,
/^តុ/i,
/^វិច/i,
/^ធ/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 matchDayPeriodPatterns = {
narrow:
/^(ព្រឹក|ល្ងាច|ពេលព្រឹក|ពេលថ្ងៃត្រង់|ពេលល្ងាច|ពេលរសៀល|ពេលយប់|ពេលកណ្ដាលអធ្រាត្រ)/i,
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: function (value) {
return 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",
}),
};