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;

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

@@ -0,0 +1,147 @@
"use strict";
exports.formatDistance = void 0;
function futureSeconds(text) {
return text.replace(/sekuntia?/, "sekunnin");
}
function futureMinutes(text) {
return text.replace(/minuuttia?/, "minuutin");
}
function futureHours(text) {
return text.replace(/tuntia?/, "tunnin");
}
function futureDays(text) {
return text.replace(/päivää?/, "päivän");
}
function futureWeeks(text) {
return text.replace(/(viikko|viikkoa)/, "viikon");
}
function futureMonths(text) {
return text.replace(/(kuukausi|kuukautta)/, "kuukauden");
}
function futureYears(text) {
return text.replace(/(vuosi|vuotta)/, "vuoden");
}
const formatDistanceLocale = {
lessThanXSeconds: {
one: "alle sekunti",
other: "alle {{count}} sekuntia",
futureTense: futureSeconds,
},
xSeconds: {
one: "sekunti",
other: "{{count}} sekuntia",
futureTense: futureSeconds,
},
halfAMinute: {
one: "puoli minuuttia",
other: "puoli minuuttia",
futureTense: (_text) => "puolen minuutin",
},
lessThanXMinutes: {
one: "alle minuutti",
other: "alle {{count}} minuuttia",
futureTense: futureMinutes,
},
xMinutes: {
one: "minuutti",
other: "{{count}} minuuttia",
futureTense: futureMinutes,
},
aboutXHours: {
one: "noin tunti",
other: "noin {{count}} tuntia",
futureTense: futureHours,
},
xHours: {
one: "tunti",
other: "{{count}} tuntia",
futureTense: futureHours,
},
xDays: {
one: "päivä",
other: "{{count}} päivää",
futureTense: futureDays,
},
aboutXWeeks: {
one: "noin viikko",
other: "noin {{count}} viikkoa",
futureTense: futureWeeks,
},
xWeeks: {
one: "viikko",
other: "{{count}} viikkoa",
futureTense: futureWeeks,
},
aboutXMonths: {
one: "noin kuukausi",
other: "noin {{count}} kuukautta",
futureTense: futureMonths,
},
xMonths: {
one: "kuukausi",
other: "{{count}} kuukautta",
futureTense: futureMonths,
},
aboutXYears: {
one: "noin vuosi",
other: "noin {{count}} vuotta",
futureTense: futureYears,
},
xYears: {
one: "vuosi",
other: "{{count}} vuotta",
futureTense: futureYears,
},
overXYears: {
one: "yli vuosi",
other: "yli {{count}} vuotta",
futureTense: futureYears,
},
almostXYears: {
one: "lähes vuosi",
other: "lähes {{count}} vuotta",
futureTense: futureYears,
},
};
const formatDistance = (token, count, options) => {
const tokenValue = formatDistanceLocale[token];
const result =
count === 1
? tokenValue.one
: tokenValue.other.replace("{{count}}", String(count));
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return tokenValue.futureTense(result) + " kuluttua";
} else {
return result + " sitten";
}
}
return result;
};
exports.formatDistance = formatDistance;

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

@@ -0,0 +1,143 @@
function futureSeconds(text) {
return text.replace(/sekuntia?/, "sekunnin");
}
function futureMinutes(text) {
return text.replace(/minuuttia?/, "minuutin");
}
function futureHours(text) {
return text.replace(/tuntia?/, "tunnin");
}
function futureDays(text) {
return text.replace(/päivää?/, "päivän");
}
function futureWeeks(text) {
return text.replace(/(viikko|viikkoa)/, "viikon");
}
function futureMonths(text) {
return text.replace(/(kuukausi|kuukautta)/, "kuukauden");
}
function futureYears(text) {
return text.replace(/(vuosi|vuotta)/, "vuoden");
}
const formatDistanceLocale = {
lessThanXSeconds: {
one: "alle sekunti",
other: "alle {{count}} sekuntia",
futureTense: futureSeconds,
},
xSeconds: {
one: "sekunti",
other: "{{count}} sekuntia",
futureTense: futureSeconds,
},
halfAMinute: {
one: "puoli minuuttia",
other: "puoli minuuttia",
futureTense: (_text) => "puolen minuutin",
},
lessThanXMinutes: {
one: "alle minuutti",
other: "alle {{count}} minuuttia",
futureTense: futureMinutes,
},
xMinutes: {
one: "minuutti",
other: "{{count}} minuuttia",
futureTense: futureMinutes,
},
aboutXHours: {
one: "noin tunti",
other: "noin {{count}} tuntia",
futureTense: futureHours,
},
xHours: {
one: "tunti",
other: "{{count}} tuntia",
futureTense: futureHours,
},
xDays: {
one: "päivä",
other: "{{count}} päivää",
futureTense: futureDays,
},
aboutXWeeks: {
one: "noin viikko",
other: "noin {{count}} viikkoa",
futureTense: futureWeeks,
},
xWeeks: {
one: "viikko",
other: "{{count}} viikkoa",
futureTense: futureWeeks,
},
aboutXMonths: {
one: "noin kuukausi",
other: "noin {{count}} kuukautta",
futureTense: futureMonths,
},
xMonths: {
one: "kuukausi",
other: "{{count}} kuukautta",
futureTense: futureMonths,
},
aboutXYears: {
one: "noin vuosi",
other: "noin {{count}} vuotta",
futureTense: futureYears,
},
xYears: {
one: "vuosi",
other: "{{count}} vuotta",
futureTense: futureYears,
},
overXYears: {
one: "yli vuosi",
other: "yli {{count}} vuotta",
futureTense: futureYears,
},
almostXYears: {
one: "lähes vuosi",
other: "lähes {{count}} vuotta",
futureTense: futureYears,
},
};
export const formatDistance = (token, count, options) => {
const tokenValue = formatDistanceLocale[token];
const result =
count === 1
? tokenValue.one
: tokenValue.other.replace("{{count}}", String(count));
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return tokenValue.futureTense(result) + " kuluttua";
} else {
return result + " sitten";
}
}
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/fi/_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/fi/_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 d. MMMM y",
long: "d. MMMM y",
medium: "d. MMM y",
short: "d.M.y",
};
const timeFormats = {
full: "HH.mm.ss zzzz",
long: "HH.mm.ss z",
medium: "HH.mm.ss",
short: "HH.mm",
};
const dateTimeFormats = {
full: "{{date}} 'klo' {{time}}",
long: "{{date}} 'klo' {{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/fi/_lib/formatLong.mjs generated vendored Normal file
View File

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "eeee d. MMMM y",
long: "d. MMMM y",
medium: "d. MMM y",
short: "d.M.y",
};
const timeFormats = {
full: "HH.mm.ss zzzz",
long: "HH.mm.ss z",
medium: "HH.mm.ss",
short: "HH.mm",
};
const dateTimeFormats = {
full: "{{date}} 'klo' {{time}}",
long: "{{date}} 'klo' {{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/fi/_lib/formatRelative.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "'viime' eeee 'klo' p",
yesterday: "'eilen klo' p",
today: "'tänään klo' p",
tomorrow: "'huomenna klo' p",
nextWeek: "'ensi' eeee 'klo' p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,11 @@
const formatRelativeLocale = {
lastWeek: "'viime' eeee 'klo' p",
yesterday: "'eilen klo' p",
today: "'tänään klo' p",
tomorrow: "'huomenna klo' p",
nextWeek: "'ensi' eeee 'klo' p",
other: "P",
};
export const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];

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

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

@@ -0,0 +1,170 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["eaa.", "jaa."],
abbreviated: ["eaa.", "jaa."],
wide: ["ennen ajanlaskun alkua", "jälkeen ajanlaskun alun"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1. kvartaali", "2. kvartaali", "3. kvartaali", "4. kvartaali"],
};
const monthValues = {
narrow: ["T", "H", "M", "H", "T", "K", "H", "E", "S", "L", "M", "J"],
abbreviated: [
"tammi",
"helmi",
"maalis",
"huhti",
"touko",
"kesä",
"heinä",
"elo",
"syys",
"loka",
"marras",
"joulu",
],
wide: [
"tammikuu",
"helmikuu",
"maaliskuu",
"huhtikuu",
"toukokuu",
"kesäkuu",
"heinäkuu",
"elokuu",
"syyskuu",
"lokakuu",
"marraskuu",
"joulukuu",
],
};
const formattingMonthValues = {
narrow: monthValues.narrow,
abbreviated: monthValues.abbreviated,
wide: [
"tammikuuta",
"helmikuuta",
"maaliskuuta",
"huhtikuuta",
"toukokuuta",
"kesäkuuta",
"heinäkuuta",
"elokuuta",
"syyskuuta",
"lokakuuta",
"marraskuuta",
"joulukuuta",
],
};
const dayValues = {
narrow: ["S", "M", "T", "K", "T", "P", "L"],
short: ["su", "ma", "ti", "ke", "to", "pe", "la"],
abbreviated: ["sunn.", "maan.", "tiis.", "kesk.", "torst.", "perj.", "la"],
wide: [
"sunnuntai",
"maanantai",
"tiistai",
"keskiviikko",
"torstai",
"perjantai",
"lauantai",
],
};
const formattingDayValues = {
narrow: dayValues.narrow,
short: dayValues.short,
abbreviated: dayValues.abbreviated,
wide: [
"sunnuntaina",
"maanantaina",
"tiistaina",
"keskiviikkona",
"torstaina",
"perjantaina",
"lauantaina",
],
};
const dayPeriodValues = {
narrow: {
am: "ap",
pm: "ip",
midnight: "keskiyö",
noon: "keskipäivä",
morning: "ap",
afternoon: "ip",
evening: "illalla",
night: "yöllä",
},
abbreviated: {
am: "ap",
pm: "ip",
midnight: "keskiyö",
noon: "keskipäivä",
morning: "ap",
afternoon: "ip",
evening: "illalla",
night: "yöllä",
},
wide: {
am: "ap",
pm: "ip",
midnight: "keskiyöllä",
noon: "keskipäivällä",
morning: "aamupäivällä",
afternoon: "iltapäivällä",
evening: "illalla",
night: "yöllä",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + ".";
};
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",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
formattingValues: formattingDayValues,
defaultFormattingWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
}),
});

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

@@ -0,0 +1,168 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["eaa.", "jaa."],
abbreviated: ["eaa.", "jaa."],
wide: ["ennen ajanlaskun alkua", "jälkeen ajanlaskun alun"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1. kvartaali", "2. kvartaali", "3. kvartaali", "4. kvartaali"],
};
const monthValues = {
narrow: ["T", "H", "M", "H", "T", "K", "H", "E", "S", "L", "M", "J"],
abbreviated: [
"tammi",
"helmi",
"maalis",
"huhti",
"touko",
"kesä",
"heinä",
"elo",
"syys",
"loka",
"marras",
"joulu",
],
wide: [
"tammikuu",
"helmikuu",
"maaliskuu",
"huhtikuu",
"toukokuu",
"kesäkuu",
"heinäkuu",
"elokuu",
"syyskuu",
"lokakuu",
"marraskuu",
"joulukuu",
],
};
const formattingMonthValues = {
narrow: monthValues.narrow,
abbreviated: monthValues.abbreviated,
wide: [
"tammikuuta",
"helmikuuta",
"maaliskuuta",
"huhtikuuta",
"toukokuuta",
"kesäkuuta",
"heinäkuuta",
"elokuuta",
"syyskuuta",
"lokakuuta",
"marraskuuta",
"joulukuuta",
],
};
const dayValues = {
narrow: ["S", "M", "T", "K", "T", "P", "L"],
short: ["su", "ma", "ti", "ke", "to", "pe", "la"],
abbreviated: ["sunn.", "maan.", "tiis.", "kesk.", "torst.", "perj.", "la"],
wide: [
"sunnuntai",
"maanantai",
"tiistai",
"keskiviikko",
"torstai",
"perjantai",
"lauantai",
],
};
const formattingDayValues = {
narrow: dayValues.narrow,
short: dayValues.short,
abbreviated: dayValues.abbreviated,
wide: [
"sunnuntaina",
"maanantaina",
"tiistaina",
"keskiviikkona",
"torstaina",
"perjantaina",
"lauantaina",
],
};
const dayPeriodValues = {
narrow: {
am: "ap",
pm: "ip",
midnight: "keskiyö",
noon: "keskipäivä",
morning: "ap",
afternoon: "ip",
evening: "illalla",
night: "yöllä",
},
abbreviated: {
am: "ap",
pm: "ip",
midnight: "keskiyö",
noon: "keskipäivä",
morning: "ap",
afternoon: "ip",
evening: "illalla",
night: "yöllä",
},
wide: {
am: "ap",
pm: "ip",
midnight: "keskiyöllä",
noon: "keskipäivällä",
morning: "aamupäivällä",
afternoon: "iltapäivällä",
evening: "illalla",
night: "yöllä",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + ".";
};
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",
formattingValues: formattingDayValues,
defaultFormattingWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
}),
};

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

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

@@ -0,0 +1,137 @@
"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: /^(e|j)/i,
abbreviated: /^(eaa.|jaa.)/i,
wide: /^(ennen ajanlaskun alkua|jälkeen ajanlaskun alun)/i,
};
const parseEraPatterns = {
any: [/^e/i, /^j/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234]\.? kvartaali/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[thmkeslj]/i,
abbreviated:
/^(tammi|helmi|maalis|huhti|touko|kesä|heinä|elo|syys|loka|marras|joulu)/i,
wide: /^(tammikuu|helmikuu|maaliskuu|huhtikuu|toukokuu|kesäkuu|heinäkuu|elokuu|syyskuu|lokakuu|marraskuu|joulukuu)(ta)?/i,
};
const parseMonthPatterns = {
narrow: [
/^t/i,
/^h/i,
/^m/i,
/^h/i,
/^t/i,
/^k/i,
/^h/i,
/^e/i,
/^s/i,
/^l/i,
/^m/i,
/^j/i,
],
any: [
/^ta/i,
/^hel/i,
/^maa/i,
/^hu/i,
/^to/i,
/^k/i,
/^hei/i,
/^e/i,
/^s/i,
/^l/i,
/^mar/i,
/^j/i,
],
};
const matchDayPatterns = {
narrow: /^[smtkpl]/i,
short: /^(su|ma|ti|ke|to|pe|la)/i,
abbreviated: /^(sunn.|maan.|tiis.|kesk.|torst.|perj.|la)/i,
wide: /^(sunnuntai|maanantai|tiistai|keskiviikko|torstai|perjantai|lauantai)(na)?/i,
};
const parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^k/i, /^t/i, /^p/i, /^l/i],
any: [/^s/i, /^m/i, /^ti/i, /^k/i, /^to/i, /^p/i, /^l/i],
};
const matchDayPeriodPatterns = {
narrow:
/^(ap|ip|keskiyö|keskipäivä|aamupäivällä|iltapäivällä|illalla|yöllä)/i,
any: /^(ap|ip|keskiyöllä|keskipäivällä|aamupäivällä|iltapäivällä|illalla|yöllä)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^ap/i,
pm: /^ip/i,
midnight: /^keskiyö/i,
noon: /^keskipäivä/i,
morning: /aamupäivällä/i,
afternoon: /iltapäivällä/i,
evening: /illalla/i,
night: /yöllä/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",
}),
});

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

@@ -0,0 +1,134 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)(\.)/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(e|j)/i,
abbreviated: /^(eaa.|jaa.)/i,
wide: /^(ennen ajanlaskun alkua|jälkeen ajanlaskun alun)/i,
};
const parseEraPatterns = {
any: [/^e/i, /^j/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234]\.? kvartaali/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[thmkeslj]/i,
abbreviated:
/^(tammi|helmi|maalis|huhti|touko|kesä|heinä|elo|syys|loka|marras|joulu)/i,
wide: /^(tammikuu|helmikuu|maaliskuu|huhtikuu|toukokuu|kesäkuu|heinäkuu|elokuu|syyskuu|lokakuu|marraskuu|joulukuu)(ta)?/i,
};
const parseMonthPatterns = {
narrow: [
/^t/i,
/^h/i,
/^m/i,
/^h/i,
/^t/i,
/^k/i,
/^h/i,
/^e/i,
/^s/i,
/^l/i,
/^m/i,
/^j/i,
],
any: [
/^ta/i,
/^hel/i,
/^maa/i,
/^hu/i,
/^to/i,
/^k/i,
/^hei/i,
/^e/i,
/^s/i,
/^l/i,
/^mar/i,
/^j/i,
],
};
const matchDayPatterns = {
narrow: /^[smtkpl]/i,
short: /^(su|ma|ti|ke|to|pe|la)/i,
abbreviated: /^(sunn.|maan.|tiis.|kesk.|torst.|perj.|la)/i,
wide: /^(sunnuntai|maanantai|tiistai|keskiviikko|torstai|perjantai|lauantai)(na)?/i,
};
const parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^k/i, /^t/i, /^p/i, /^l/i],
any: [/^s/i, /^m/i, /^ti/i, /^k/i, /^to/i, /^p/i, /^l/i],
};
const matchDayPeriodPatterns = {
narrow:
/^(ap|ip|keskiyö|keskipäivä|aamupäivällä|iltapäivällä|illalla|yöllä)/i,
any: /^(ap|ip|keskiyöllä|keskipäivällä|aamupäivällä|iltapäivällä|illalla|yöllä)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^ap/i,
pm: /^ip/i,
midnight: /^keskiyö/i,
noon: /^keskipäivä/i,
morning: /aamupäivällä/i,
afternoon: /iltapäivällä/i,
evening: /illalla/i,
night: /yöllä/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",
}),
};