zoukankan      html  css  js  c++  java
  • Datetimepiker 时间选择

    Datetimepiker是一个BootStrap的组件,用于实现时间的精确选择。

    引用css和js文件

    <link rel="stylesheet" href="{% static 'web/datetimepicker/bootstrapdatetimepicker.min.css' %}">
    <script src="{% static 'web/datetimepicker/bootstrapdatetimepicker.min.js' %}"></script>    <script src="{% static 'web/datetimepicker/bootstrapdatetimepicker.zh-CN.js' %}"></script
    

    html标签

    <input id='i1' />
    

    应用到标签

    $('#i1,#i2').datetimepicker({    
    	language: "zh-CN",    
    	minView: "hour",    
    	sideBySide: true,    
    	format: 'yyyy-mm-dd hh:ii',    
    	bootcssVer: 3, 
    	startDate: new Date(),    
    	autoclose: true 
    })
    
    

    扩展: js中对时间的格式化

    Date.prototype.Format = function (fmt) { //author: meizz            
    	var o = {
    		"M+": this.getMonth() + 1,                
    		"d+": this.getDate(), //෭                
    		"h+": this.getHours(), //ੜ෸                
    		"m+": this.getMinutes(), //ړ                
    		"s+": this.getSeconds(), //ᑁ                
    		"q+": Math.floor((this.getMonth() + 3) / 3), //ਊଶ                	  "S": this.getMilliseconds() //ྺᑁ            
    		};            
    		if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));            			for (var k in o)                
    			if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    			return fmt;
    		};
    
  • 相关阅读:
    MapReduce的DBInputFormat使用
    HDFS NameNode与DataNode介绍
    Hadoop的SequenceFile读实例
    Hadoop的SequenceFile读写实例
    MapReduce工作流程详解
    hadoop使用yarn运行mapreduce的过程
    MapReduce的WordCount
    Hadoop的SequenceFile写实例
    Spring的拦截器和监听器
    Hadoop简介
  • 原文地址:https://www.cnblogs.com/yzm1017/p/13571012.html
Copyright © 2011-2022 走看看