codigo0/node_modules/date-fns/locale/sr/_lib/localize.mjs
planetazuzu 5d7a6500fe refactor: Fase 1 - Clean Architecture, refactorización modular y eliminación de duplicidades
-  Ticket 1.1: Estructura Clean Architecture en backend
-  Ticket 1.2: Schemas Zod compartidos
-  Ticket 1.3: Refactorización drugs.ts (1362 → 8 archivos modulares)
-  Ticket 1.4: Refactorización procedures.ts (3583 → 6 archivos modulares)
-  Ticket 1.5: Eliminación de duplicidades (~50 líneas)

Cambios principales:
- Creada estructura Clean Architecture en backend/src/
- Schemas Zod compartidos en backend/src/shared/schemas/
- Refactorización modular de drugs y procedures
- Utilidades genéricas en src/utils/ (filter, validation)
- Eliminados scripts obsoletos y documentación antigua
- Corregidos errores: QueryClient, import test-error-handling
- Build verificado y funcionando correctamente
2026-01-25 21:09:47 +01:00

228 lines
4.1 KiB
JavaScript
Raw 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",
}),
};