This commit is contained in:
2025-11-30 00:34:56 +01:00
parent 337c847d79
commit cf0c43a211
38 changed files with 4024 additions and 1325 deletions

View File

@@ -17,10 +17,12 @@ import timeGridPlugin from "@fullcalendar/timegrid";
import interactionPlugin from "@fullcalendar/interaction";
import { useNavigate } from "react-router-dom";
import dayjs from "dayjs";
import { useTranslation } from "react-i18next";
import { eventiService } from "../services/eventiService";
export default function CalendarioPage() {
const navigate = useNavigate();
const { t, i18n } = useTranslation();
const [dateRange, setDateRange] = useState({
start: dayjs().startOf("month").format("YYYY-MM-DD"),
end: dayjs().endOf("month").format("YYYY-MM-DD"),
@@ -73,7 +75,7 @@ export default function CalendarioPage() {
return (
<Box>
<Typography variant="h4" gutterBottom>
Calendario Eventi
{t("calendar.title")}
</Typography>
<Paper sx={{ p: 2 }}>
@@ -85,7 +87,7 @@ export default function CalendarioPage() {
center: "title",
right: "dayGridMonth,timeGridWeek,timeGridDay",
}}
locale="it"
locale={i18n.language}
events={eventi.map((e) => ({
id: String(e.id),
title: e.title,
@@ -109,27 +111,27 @@ export default function CalendarioPage() {
meridiem: false,
}}
buttonText={{
today: "Oggi",
month: "Mese",
week: "Settimana",
day: "Giorno",
today: t("calendar.today"),
month: t("calendar.month"),
week: t("calendar.week"),
day: t("calendar.day"),
}}
/>
</Paper>
{/* Dialog per creazione nuovo evento */}
<Dialog open={newEventDialog.open} onClose={handleCloseDialog}>
<DialogTitle>Nuovo Evento</DialogTitle>
<DialogTitle>{t("calendar.newEvent")}</DialogTitle>
<DialogContent>
<DialogContentText>
Vuoi creare un nuovo evento per il giorno{" "}
{t("calendar.createEventConfirm")}{" "}
<strong>{newEventDialog.formattedDate}</strong>?
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={handleCloseDialog}>Annulla</Button>
<Button onClick={handleCloseDialog}>{t("common.cancel")}</Button>
<Button onClick={handleCreateEvent} variant="contained" autoFocus>
Crea Evento
{t("calendar.createEvent")}
</Button>
</DialogActions>
</Dialog>