在模板中引用响应的文件

比如:

layout.html

<link rel="stylesheet" href="{% static 'stark/plugins/datetimepicker/css/bootstrap-datetimepicker.css' %} "/>
<script src="{% static 'stark/plugins/datetimepicker/js/bootstrap-datetimepicker.js' %} "></script>
<script src="{% static 'stark/plugins/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js' %} "></script>

在自己modelform中;

from django import forms

class DateTimePickerInput(forms.TextInput):
template_name = 'stark/forms/widgets/datetime_picker.html' class ClassListModelForm(StarkModelForm):
class Meta:
model = models.ClassList
fields = '__all__'
widgets = {
'start_date': DateTimePickerInput,
'graduate_date': DateTimePickerInput,
}

datetime_picker.html

<div class="input-group date form_date">
<input readonly class="form-control" type="{{ widget.type }}" name="{{ widget.name }}"{% if widget.value != None %}
value="{{ widget.value|stringformat:'s' }}"{% endif %}{% include "django/forms/widgets/attrs.html" %} />
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
</div>

25 bootstrap--v3--datetimepicker时间选择器--应用的更多相关文章

  1. 【bootstrap】时间选择器datetimepicker和daterangepicker

    在bootstrap中的时间选择器有两种:dateTimePicker和dateRangePicker 1.dateTimePicker好像是官方嫡插件:   需要的文件: <link rel= ...

  2. 【angular+bootstrap】angular初级的时间选择器

    近期的一个项目,是用angular来写的,本来框架就是第一次接触,使用相关插件的时候就感觉更加没有头绪了,其中一个插件就是时间选择器.比较好用时间选择器就是bootstrap里面的datetimepi ...

  3. bootstrap datetimepicker时间日期控件

    github地址:https://github.com/smalot/bootstrap-datetimepicker Both Date and Time picker widget based o ...

  4. bootstrap 时间选择器 datetime

    $("'#datetimepicker").datetimepicker({ format: "yyyy-mm-dd hh:ii:ss",//设置时间格式,默认 ...

  5. 日期时间选择器、Bootstrap日期和时间表单组件。bootstrap-datetimepicker实现年月日,时分秒的选择。

    参考链接:http://www.bootcss.com/p/bootstrap-datetimepicker/ 1.官网以及很详细的说明了如何使用,这里结合一下自己的使用来写下. 下载解压缩包以后,可 ...

  6. ClockPicker – 时钟风格 Bootstrap 时间选择器

    ClockPicker 是国内前端开发者发布的一个时钟样式 Timepicker,可以用于 Bootstrap 和 jQuery.所有主流浏览器都支持,包括 IE9+,支持移动设备,能够在触摸屏设备很 ...

  7. bootstrap的datetimepicker.js的结束时间大于开始时间,当前日期之前的代码

    感觉不错的代码,贴出来,以后接着用 <link href="__ROOT__static/css/bootstrap-datetimepicker.min.css " rel ...

  8. Bootstrap-datepicker日期时间选择器的简单使用

    日期时间选择器 目前,bootstrap有两种日历.datepicker和datetimepicker,后者是前者的拓展. Bootstrap日期和时间组件: 使用示例: 从左到右依次是十年视图.年视 ...

  9. 24款最好的jQuery日期时间选择器插件

    如果你正在创建一个网络表单,有很多事情你需要在你的应用程序中使用.有时您需要特别的输入,从用户的日期和时间,如发票日期,生日,交货时间,或任何其他此类信息.如果你有这样的需要,可以极大地从动态的jQu ...

  10. 日历插件:Bootstrap的datetimepicker插件

    注意:可以选择性引入 bootstrap.min.css和bootstrap.min.js,引入样式更好控制 option选项 0-hour 1-day 2-month 3-year 4-all ye ...

随机推荐

  1. VirtualBox + Parrot

    安装环境:win8 1.官网下载virtualbox安装包,parrot kde sequrity镜像文件 2.用virtualbox创建新的虚拟机,内存4g,类型是linux debian 64,硬 ...

  2. python 删除大于超过一定时间文件

    import os from datetime import datetime, timedelta path = "." if __name__ == '__main__': f ...

  3. java时间日期API

    package java1; import org.junit.Test; import java.util.Date; /** * @author 高槐玉 * #Description JDK 8之 ...

  4. potoshop制作一寸照片

    potoshop制作一寸照片 经常因为各种原因需要提供1寸照片,第一反应应还是跑照相馆专业.但是疫情封闭在家怎么高,刚好把偶尔使用一次的potoshop用起来,解决照片制作问题,一来能省几毛钱买茶叶蛋 ...

  5. 【git】3.5 git分支-远程分支

    资料来源 (1) https://git-scm.com/book/zh/v2/Git-%E5%88%86%E6%94%AF-%E8%BF%9C%E7%A8%8B%E5%88%86%E6%94%AF ...

  6. oracle学习之redo

    Oracle的重做日志基本概念及原理 重做日志文件 redo log file 通常也称为日志文件,它是保证数据库安全和数据库备份与恢复的文件,是数据库安全和恢复的最基本的保障.管理员可以根据日志文集 ...

  7. mysql and or优先级

    and优先级高于or, 不使用()情形:or后仍遇到and时,先算and再算or select * from table1 where f1=1 and f2=2 or f3=3 and f4=4 o ...

  8. 查询最上活动的activity

    adb shell dumpsys window windows | grep mCurrent

  9. Linux profile、bashrc、bash_profile

    一.profile 文件 1.profile 文件的作用 profile(/etc/profile),用于设置系统级的环境变量和启动程序,在这个文件下配置会对所有用户生效.当用户登录(login)时, ...

  10. 像MIUI一样做Zabbix二次开发(2)——Zabbix与商业及开源产品的比较分析

    Zabbix的特点 Zabbix是一个基于WEB界面的提供分布式系统监控的开源解决方案,通过浏览器监视,做到告警分级处理.网络访问安全可控,该开源平台在全球有广泛的用户基础,他的特点: 开放性:源代码 ...