djangodatedatetime

DateTime Django. Capitalize the first Letter in French


In my django app, I display a dateTime in my template:

       {{object.date}}

I wan't to display it in French. So in my settings, I put

       LANGUAGE_CODE = 'fr_FR'
       DATETIME_FORMAT = ('l d F Y - H:i')

Everything works except that the first letter of the days is not capitalized, while it was in english.

I guess I have to modify it directly in the django code, but I don't know where to find it.

Any help would be very welcome. Thank you.


Solution

  • Building on Leandro's answer, you could try {{ object.date|date:"DATETIME_FORMAT"|capfirst }} which should convert the date to the format first, and then capitalize.