简体   繁体   English

如何将日期选择器放入Django应用程序?

[英]how do you put a datepicker into a django app?

I'd like to put a datepicker type of widget into my Django app so that users don't have to try and use a textbox to enter a date and a time. 我想将日期选择器类型的小部件放入我的Django应用程序中,以便用户不必尝试使用文本框输入日期和时间。 I've found some references to widgets and forms but can't find anything about how to put them into a page on my Django site. 我找到了一些关于小部件和表单的引用,但是找不到有关如何将其放入Django网站上的页面的任何信息。 Any guidance on how to use these features to meet this end would be greatly appreciated. 任何有关如何使用这些功能来达到此目的的指导将不胜感激。

The https://github.com/tarruda/bootstrap-datetimepicker does not work in Bootstrap 3.0 (is not mantained anymore). https://github.com/tarruda/bootstrap-datetimepicker 在Bootstrap 3.0中不起作用 (不再提供)。 I use this one , and it solves my problem. 我用这个 ,它解决了我的问题。 Hope this helps! 希望这可以帮助!

The easiest way to do this would be to use a javascript date/time picker that populates a text field with the date/time. 最简单的方法是使用JavaScript日期/时间选择器,该选择器使用日期/时间填充文本字段。

Here is an example: http://tarruda.github.io/bootstrap-datetimepicker/ . 这是一个示例: http : //tarruda.github.io/bootstrap-datetimepicker/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM