时间插件datetimepicker

相关datetimepicker用法查看官网http://eonasdan.github.io/bootstrap-datetimepicker/

{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试datetimepicker插件</title>
    {#需要引入js、css文件#}
    <script src="{% static "components/jquery/dist/jquery.js" %}"></script>
    <script src="{% static "components/bootstrap/dist/js/bootstrap.js" %}"></script>
    <link rel="stylesheet" href="{% static "ace/css/bootstrap.css" %}"/>
    <script src="{% static "components/moment/moment.js" %}"></script>
    <link href="https://cdn.bootcss.com/smalot-bootstrap-datetimepicker/2.4.4/css/bootstrap-datetimepicker.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/smalot-bootstrap-datetimepicker/2.4.4/js/bootstrap-datetimepicker.js"></script>
    {#重要,弹出日历里面显示的文字bootstrap里面显示的是英文 ,触发后显示的年月日等的显示文字,即为:Jan,feb等#}
    <script src="https://cdn.bootcss.com/smalot-bootstrap-datetimepicker/2.4.4/js/locales/bootstrap-datetimepicker.fr.js"></script>
    {#中文显示#}
    <script src="https://cdn.bootcss.com/smalot-bootstrap-datetimepicker/2.4.4/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
</head>
<body>
<input type="text" id="start_time" name="start_time">
<input type="text" id="end_time" name="end_time">
</body>
</html>
<script>
    $('#start_time').datetimepicker({
        format: 'yyyy-mm-dd hh:ii:ss',
        todayBtn:true,
        clearBtn:true,
    });
    $('#end_time').datetimepicker({
        format: 'yyyy-mm-dd hh:ii:ss',
        todayBtn:true,
    });
</script>

 

转载于:https://www.cnblogs.com/konglingxi/p/10130836.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值