• EasyUI篇の日期控件


    页面代码:

    1 <input type="text" id='astartTime' class="easyui-datebox" style=" 150px;" />
    View Code

    JS代码:

     1 <script type="text/javascript">
     2         $(function () {
     3             $("#astartTime").datebox({
     4                 onSelect: function (date) {   //选择日期
     5                     $("#astartTime ").val(date);
     6                     alert(date.getFullYear() + "年" + (date.getMonth() + 1) + "月" + date.getDate() + "日");
     7                 }
     8             });
     9         })
    10         window.onload = function () {
    11             $('#astartTime').datebox('setValue', formatterDate(new Date()));//设置日期初始日期为当前日期
    12         }
    13         formatterDate = function (date) {
    14             var day = date.getDate() > 9 ? date.getDate() : "0" + date.getDate();
    15             var month = (date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : "0" + (date.getMonth() + 1);
    16             return date.getFullYear() + '-' + month + '-' + day;
    17         };
    18     </script>
    View Code

    运行效果图:

  • 相关阅读:
    redis 学习笔记三
    hadoop 家族图
    hbase 笔记
    spark history server
    利用Intellij IDEA构建spark开发环境
    自己安装的工具版本
    hive读书笔记
    数据仓库元数据
    Spark RDD
    pg mysql 比较
  • 原文地址:https://www.cnblogs.com/dabexiong/p/4964077.html
Copyright © 2020-2023  润新知