05.LoT.UI 前后台通用框架分解系列之——漂亮的时间选择器

简介:

LOT.UI分解系列汇总:http://www.cnblogs.com/dunitian/p/4822808.html#lotui

LoT.UI开源地址如下:https://github.com/dunitian/LoTCodeBase/tree/master/LoTUI

先看在LoT.UI里面的应用效果图:

关键代码解析:(https://github.com/dunitian/LoTCodeBase/blob/master/LoTUI/Manager/Demo/datepicker.html

头部引用CSS:

日期选择器定义

引入Script并初始化

案例代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html>
<head>
     <meta charset= "utf-8" >
     <meta http-equiv= "X-UA-Compatible"  content= "IE=edge" >
     <meta name= "viewport"  content= "width=device-width, initial-scale=1" >
     <title>datepicker</title>
     <link rel= "stylesheet"  href= "http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" >
     <link href= "/open/bootstrap-datepicker/bootstrap-datetimepicker.min.css"  rel= "stylesheet"  />
     <!--[ if  lt IE 9]>
         <script src= "https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js" ></script>
         <script src= "https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js" ></script>
     <![endif]-->
</head>
<body>
     <div  class = "col-lg-1" ></div>
     <div  class = "col-lg-3" >
         <div  class = "input-group" >
             <span  class = "input-group-addon" >时间</span><input type= "text"  class = "form-control lot-time"  placeholder= "请选择时间..." >
         </div>
     </div>
     <script src= "http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js" ></script>
     <script src= "http://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js" ></script>
     <script src= "/open/bootstrap-datepicker/bootstrap-datetimepicker.min.js" ></script>
     <script src= "/open/bootstrap-datepicker/bootstrap-datetimepicker.zh-CN.js" ></script>
     <script type= "text/javascript" >
         //时间控件
         $(function () {
             $( '.lot-time' ).datetimepicker({
                 format:  "yyyy-mm-dd hh:ii" ,
                 todayBtn:  "linked" ,
                 language:  "zh-CN" ,
                 autoclose:  true
             });
         })
     </script>
</body>
</html>

推荐组件:https://github.com/smalot/bootstrap-datetimepicker

原有组件:https://github.com/eternicode/bootstrap-datepicker


本文转自毒逆天博客园博客,原文链接:http://www.cnblogs.com/dunitian/p/5524019.html,如需转载请自行联系原作者


相关文章
|
2月前
|
人工智能 前端开发 搜索推荐
前端UI框架的发展:从混沌到秩序的演变
前端UI框架的发展:从混沌到秩序的演变
|
2月前
|
XML 前端开发 JavaScript
深入介绍 UI5 框架里 Smart Field 控件的工作原理
深入介绍 UI5 框架里 Smart Field 控件的工作原理
19 0
|
7天前
|
开发框架 前端开发 JavaScript
学会Web UI框架--Bootstrap,快速搭建出漂亮的前端界面
学会Web UI框架--Bootstrap,快速搭建出漂亮的前端界面
|
2月前
|
Linux API Android开发
Airtest UI自动化框架 v1.1.4
Airtest UI自动化框架 v1.1.4
30 3
|
3月前
|
前端开发 JavaScript
响应式UI框架
响应式UI框架
54 0
响应式UI框架
|
2月前
|
前端开发 搜索推荐 开发者
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
32 0
|
2月前
|
JavaScript 前端开发 开发者
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
17 0
|
2月前
|
前端开发 JavaScript API
SAP UI5 sap.ui.require.toUrl 的作用介绍
SAP UI5 sap.ui.require.toUrl 的作用介绍
33 0
|
2月前
|
JSON 前端开发 测试技术
SAP UI5 sap.ui.core.util.MockServer.simulate 方法介绍
SAP UI5 sap.ui.core.util.MockServer.simulate 方法介绍
21 0
|
2月前
使用 SAP UI5 Event Bus 机制,修复 SAP UI5 分页显示数据的一个 bug 试读版
使用 SAP UI5 Event Bus 机制,修复 SAP UI5 分页显示数据的一个 bug 试读版
21 0