0

I've created a project that use a react-date-range component and i need to change the default language to PT.

DateRangePicker is in Portuguese but the DefinedRange in English and i need it in PT.

At this moment I've tried: import pt from 'date-fns/locale/pt'; and

<DateRangePicker
  locale={pt}
  onChange={item => setRange([item.selection])}
  editableDateInputs={true}
  moveRangeOnFirstSelection={false}
  ranges={range}
  months={1}
  direction="horizontal"
/>
Sunny
  • 708
  • 1
  • 4
  • 21
André
  • 33
  • 3

1 Answers1

0

import { ptBR } from 'date-fns/locale'

locale={ptBR}

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 10 '23 at 09:27