zoukankan      html  css  js  c++  java
  • jquery日期控件+时分秒

    因为项目需要,一些时间上的查询要精确的时分.先看下效果图吧。

    所需要的js 跟css 文件

    jsp://特别注意引入的先后顺序

    <link rel="stylesheet" href="${pageContext.request.contextPath }/css/jqueryui/jquery-ui-timepicker-addon.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/css/jqueryui/demos.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/css/jqueryui/jquery-ui.css">

    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jqueryui/jquery-ui.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jqueryui/jquery-ui-timepicker-addon.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jqueryui/jquery-ui-timepicker-zh-CN.js"></script>

    $(function(){($('#startDate').datetimepicker({

    changeMonth: true,  月份可更改     

     changeYear: true, //年可更改

     timeFormat: "HH:mm:ss",//时分秒显示格式

     dateFormat: "yy-mm-dd",//年月日显示格式

      dayNamesMin: [ "七","一", "二", "三", "四", "五", "六"],//一周中文显示       

      monthNamesShort: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"],//月份中文显示

        stepHour: 2, //时间选择隔2小时,可选择      

        stepMinute: 10,       

        stepSecond: 10,//步长

    showHour:true,//是否显示小时

    showMinute:true,

    showSecond:true,

    });
    });

    到此就可以完成啦。

  • 相关阅读:
    OPENCV图像变换-1
    OPENCV形态学操作1
    OPENCV基本滤波算法
    OSX下编译安装opencv3.1.0与opencv_contrib_master
    iOS8学习笔记-构建多视图应用程序
    iOS8学习笔记2--autolayout
    iOS学习笔记1--在xcode6以上的版本中不使用storyboard以及部分控件使用
    Objective-c学习笔记3
    objective-c学习笔记2
    objective-c学习笔记
  • 原文地址:https://www.cnblogs.com/cbdd/p/5506080.html
Copyright © 2011-2022 走看看