labels={{
labelDayButton: (date, { today, selected }, options, dateLib) => {
let label = dateLib.format(date, "PPPP"); // this is not possible as `dateLib` is marked as `undefined` in the types
if (today) label = `Oggi, ${label}`;
if (selected) label = `${label}, selezionato`;
return label;
}
}
Inspired by https://github.com/gpbl/react-day-picker/discussions/2541, we should make
label*
functions type to allow the use ofdateLib
: