在Django应用程序中集成日历小部件 [英] Integrate calendar widget in Django app
本文介绍了在Django应用程序中集成日历小部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在系统中集成日历窗口小部件?我希望将日历小部件添加到我的表单中,该表单是在Django中设计的。我附上一个屏幕截图,显示我想要整合的位置。此外,我希望日历小部件像
它可能是有帮助的
How do I integrate a calendar widget in my system? I wish to add the calendar widget to my form, which has been designed in Django. I'm attaching a screenshot showing where I want to integrate it. Also, I want the calendar widget to be like http://www.dynarch.com/projects/calendar/.
What file do I need to modify and what code do I need to use?
解决方案
forms.py
import datetime
from django.forms.extras.widgets import SelectDateWidget
from django.forms import ModelForm, Form
date_field = forms.DateField(widget=SelectDateWidget)
or else there is also a another way using Javascript Using Django time/date widgets in custom form it may be helpful
这篇关于在Django应用程序中集成日历小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文