dateFormat does not reflect the chosen locale
Describe the bug When a locale is passed the dateFormat should reflect that locale and not using the default MM/dd/yyyy.
To Reproduce
- Use the provided example for setting the locale:
import { registerLocale, setDefaultLocale } from "react-datepicker";
import es from 'date-fns/locale/es';
registerLocale('es', es)
<DatePicker
locale="es"
/>
- Look at the date in the textfield, it is in the format MM/dd/yyyy
Expected behavior The date in the textbox should be in the format dd/MM/yyyy
Screenshots

Desktop (please complete the following information):
- OS: Windows
- Browser Chrome
- Version latest
Smartphone (please complete the following information):
Not tested on smartphone.
Additional context Sandbox: https://codesandbox.io/s/es-locale-forked-0d4ck
#3375
Use dateFormat prop with eg.
'P' for Long localized date
'p' for Long localized time
'Pp' for Combination of date and time
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This issue was closed because it has been stalled for 10 days with no activity.