I'm using date-fns to format my date. But a strange thing is happening: if you input today's date as 20/07/2022, it automatically subtracts one minus. That is, the date is 19/07/2022. So the problem is that every time I enter a date, my form receives it by subtracting -1. Can you tell me how to solve this problem?
const newDate = format(
new Date(date),
'dd MMM yyyy',
{
locale: ptBR,
}
)