1

I need to change the format type of date from mm/dd/yyyy to dd/mm/yyyy, if not possible what other options i have? I don't think using jQuery in a React Project is a good choice.

<input type='date' />

The default value of this is mm/dd/yyyy. This is stopping my work flow, as i can't skip it since the client insist to have the dd/mm/yyyy format.

Any help is much appreciated.

Ali
  • 1,633
  • 7
  • 35
  • 58
  • Does this answer your question? [ReactJS format date](https://stackoverflow.com/questions/45397107/reactjs-input-type-date-format-date) – Nayan Apr 22 '20 at 18:55
  • 1
    The value of an input type date is always yyyy-mm-dd. The format displayed in the UI is dependent (mostly) on the browser language. – RobG Apr 23 '20 at 03:21

1 Answers1

1

It is impossible to change the format for input type='date'. This actually has nothing to do with React. It is the browser which sets the proper format according to the locale of your browser.

you can use custom react component to force this.

Just a quick search from google: React Date Picker

Derviş Kayımbaşıoğlu
  • 28,492
  • 4
  • 50
  • 72
  • The displayed format tends to be based on *navigator.language*, but not always. There is no navigator locale. ;-) – RobG Apr 23 '20 at 03:23