1 | import React from "react";
|
2 |
|
3 | import { format } from "date-fns";
|
4 | import { it } from "date-fns/locale";
|
5 | import { DayPicker } from "react-day-picker";
|
6 |
|
7 | export function ItalianLabels() {
|
8 | return (
|
9 | <DayPicker
|
10 | locale={it}
|
11 | labels={{
|
12 | labelDayButton: (date, { today, selected }) => {
|
13 | let label = format(date, "PPPP");
|
14 | if (today) label = `Oggi, ${label}`;
|
15 | if (selected) label = `${label}, selezionato`;
|
16 | return label;
|
17 | },
|
18 | labelWeekNumber: (weekNumber) => `Settimana ${weekNumber}`,
|
19 | labelNext: () => "Prossimo mese",
|
20 | labelPrevious: () => "Mese precedente",
|
21 | labelMonthDropdown: () => "Seleziona il mese",
|
22 | labelYearDropdown: () => "Seleziona l'anno"
|
23 | }}
|
24 | />
|
25 | );
|
26 | }
|