0

The default date format in Django admin is YYYY-MM-DD, I would like to change it to DD-MM-YYYY. Based on an answer to a similar question I could update the validators to accept the new format, but if I opened an existing object, the date was still shown as YYYY-MM-DD and the JS date picker returned dates in this format, too. How to overcome these issues?

Eerik Sven Puudist
  • 2,098
  • 2
  • 23
  • 42

1 Answers1

0

After you set USE_L10N = False, add this

DATE_INPUT_FORMATS = [
'%d-%m-%Y', '%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y',
'%b %d %Y', '%b %d, %Y',  
'%d %b %Y', '%d %b, %Y',  
'%B %d %Y', '%B %d, %Y',  
'%d %B %Y', '%d %B, %Y',  
]

Change the first format if you want something else. Documentation

STIKO
  • 1,995
  • 1
  • 10
  • 9