Files
Vlad Durnea cffdf8af86
Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped
wip:milestone 0 fixes
2026-03-15 12:35:42 +02:00

228 lines
4.1 KiB
JavaScript
Raw Permalink 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.
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 = {
narrow: [
"1.",
"2.",
"3.",
"4.",
"5.",
"6.",
"7.",
"8.",
"9.",
"10.",
"11.",
"12.",
],
abbreviated: [
"јан",
"феб",
"мар",
"апр",
"мај",
"јун",
"јул",
"авг",
"сеп",
"окт",
"нов",
"дец",
],
wide: [
"јануар",
"фебруар",
"март",
"април",
"мај",
"јун",
"јул",
"август",
"септембар",
"октобар",
"новембар",
"децембар",
],
};
const formattingMonthValues = {
narrow: [
"1.",
"2.",
"3.",
"4.",
"5.",
"6.",
"7.",
"8.",
"9.",
"10.",
"11.",
"12.",
],
abbreviated: [
"јан",
"феб",
"мар",
"апр",
"мај",
"јун",
"јул",
"авг",
"сеп",
"окт",
"нов",
"дец",
],
wide: [
"јануар",
"фебруар",
"март",
"април",
"мај",
"јун",
"јул",
"август",
"септембар",
"октобар",
"новембар",
"децембар",
],
};
const dayValues = {
narrow: ["Н", "П", "У", "С", "Ч", "П", "С"],
short: ["нед", "пон", "уто", "сре", "чет", "пет", "суб"],
abbreviated: ["нед", "пон", "уто", "сре", "чет", "пет", "суб"],
wide: [
"недеља",
"понедељак",
"уторак",
"среда",
"четвртак",
"петак",
"субота",
],
};
const formattingDayPeriodValues = {
narrow: {
am: "АМ",
pm: "ПМ",
midnight: "поноћ",
noon: "подне",
morning: "ујутру",
afternoon: "поподне",
evening: "увече",
night: "ноћу",
},
abbreviated: {
am: "АМ",
pm: "ПМ",
midnight: "поноћ",
noon: "подне",
morning: "ујутру",
afternoon: "поподне",
evening: "увече",
night: "ноћу",
},
wide: {
am: "AM",
pm: "PM",
midnight: "поноћ",
noon: "подне",
morning: "ујутру",
afternoon: "после подне",
evening: "увече",
night: "ноћу",
},
};
const dayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "поноћ",
noon: "подне",
morning: "ујутру",
afternoon: "поподне",
evening: "увече",
night: "ноћу",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "поноћ",
noon: "подне",
morning: "ујутру",
afternoon: "поподне",
evening: "увече",
night: "ноћу",
},
wide: {
am: "AM",
pm: "PM",
midnight: "поноћ",
noon: "подне",
morning: "ујутру",
afternoon: "после подне",
evening: "увече",
night: "ноћу",
},
};
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",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};