Date picker not shown in html template #146
-
Please provide your configurations and softwares version
Hi. More details: |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 3 replies
-
Hi @Mehran-Isapour. Thanks for reporting. I will check it in my free time. It may take some time. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much! |
Beta Was this translation helpful? Give feedback.
-
from django_jalali.admin import widgets and use it like: widgets = {'datetime': widgets.AdminSplitjDateTime} Then, you need to include admin related js files in your template by: <script type="text/javascript" src="/admin/jsi18n/"></script>
<script type="text/javascript" src="/static/admin/js/core.js"></script>
{{ form.media }}
{{ form }} |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for your attention. |
Beta Was this translation helpful? Give feedback.
-
Yes, If you want to have Django jalali admin data picker on your form. I would suggest using another data picker plugin because this is for the admin page |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your guidance. |
Beta Was this translation helpful? Give feedback.
-
I'm closing this issue. Feel free to open it again if you have further questions. |
Beta Was this translation helpful? Give feedback.
-
hi , sorry i missed up {{ form.media }} thanks for your help |
Beta Was this translation helpful? Give feedback.
-
Hi,
in your template file. |
Beta Was this translation helpful? Give feedback.
forms.widgets.jDateTimeInput
is a form widget not adate picker
.If you want to have admin date picker in your form you have to use admin.widgets.AdminSplitjDateTime for DateTimeField and admin.widgets.AdminjDateWidget for DateField.
To enable it for your model form first import it:
and use it like:
Then, you need to include admin related js files in your template by: