react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

Set Locale is not working

Open bryannbarbosa opened this issue 6 years ago • 2 comments

Set the locale property in the component is not changing the texts in datePicker, how to fix this? Thanks in advance!

My code:

<DatePicker
     date={this.state.date}
     locale="pt"
     onSelect={date => {
        this.setState(state => ({ date: date }));
    }} />

bryannbarbosa avatar Aug 26 '19 19:08 bryannbarbosa

This component uses moment.js under the hood. Have you properly configured moment.js with "pt" language enabled?

cheton avatar Sep 06 '19 06:09 cheton

Also see the following comments if you encountered similiar issue:

  • https://github.com/Hacker0x01/react-datepicker/issues/1203#issuecomment-421343908
  • https://github.com/Hacker0x01/react-datepicker/issues/1203#issuecomment-369873137

cheton avatar Sep 06 '19 15:09 cheton