codigo0/node_modules/date-fns/locale/el/_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

182 lines
3.7 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: ["Ι", "Φ", "Μ", "Α", "Μ", "Ι", "Ι", "Α", "Σ", "Ο", "Ν", "Δ"],
abbreviated: [
"Ιαν",
"Φεβ",
"Μάρ",
"Απρ",
"Μάι",
"Ιούν",
"Ιούλ",
"Αύγ",
"Σεπ",
"Οκτ",
"Νοέ",
"Δεκ",
],
wide: [
"Ιανουάριος",
"Φεβρουάριος",
"Μάρτιος",
"Απρίλιος",
"Μάιος",
"Ιούνιος",
"Ιούλιος",
"Αύγουστος",
"Σεπτέμβριος",
"Οκτώβριος",
"Νοέμβριος",
"Δεκέμβριος",
],
};
const formattingMonthValues = {
narrow: ["Ι", "Φ", "Μ", "Α", "Μ", "Ι", "Ι", "Α", "Σ", "Ο", "Ν", "Δ"],
abbreviated: [
"Ιαν",
"Φεβ",
"Μαρ",
"Απρ",
"Μαΐ",
"Ιουν",
"Ιουλ",
"Αυγ",
"Σεπ",
"Οκτ",
"Νοε",
"Δεκ",
],
wide: [
"Ιανουαρίου",
"Φεβρουαρίου",
"Μαρτίου",
"Απριλίου",
"Μαΐου",
"Ιουνίου",
"Ιουλίου",
"Αυγούστου",
"Σεπτεμβρίου",
"Οκτωβρίου",
"Νοεμβρίου",
"Δεκεμβρίου",
],
};
const dayValues = {
narrow: ["Κ", "Δ", "T", "Τ", "Π", "Π", "Σ"],
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 ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = options?.unit;
let suffix;
if (unit === "year" || unit === "month") {
suffix = "ος";
} else if (
unit === "week" ||
unit === "dayOfYear" ||
unit === "day" ||
unit === "hour" ||
unit === "date"
) {
suffix = "η";
} else {
suffix = "ο";
}
return number + suffix;
};
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",
}),
};