slashmili / django-jalali

Jalali DateField support for Django model
http://pypi.python.org/pypi/django_jalali
BSD 3-Clause "New" or "Revised" License
258 stars 52 forks source link

jDateTimeField doesn't use django format localization #128

Closed AmirMahmood closed 3 years ago

AmirMahmood commented 3 years ago

I have a DateTimeField with editable=False. admin page shows this field like this:

31 دسامبر 2020، ساعت 17:57

but when i change DateTimeField to jDateTimeField, it looks like below:

1399-10-11 17:57:18.740070+0330

it seems jDateTimeField doesn't use django format localization settings like DATETIME_FORMAT.

hramezani commented 3 years ago

Yes, That's true because Django Jalali uses Python Jalali. when you use jDateTimeField, Django Jalali replaced datetime objects with jdatetime and 1399-10-11 17:57:18.740070+0330 comes from python jalali datetime str function.

That would be good to Django DATETIME_FORMAT to format datetime in Django Jalali. @AmirMahmood Would you like to work on this?

AmirMahmood commented 3 years ago

Currently, I have no idea how to add this feature. :) but I will create PR if I find any suitable solution.