zoukankan      html  css  js  c++  java
  • EasyUI日期控件获值和赋值

    一,获值

     1.$("#id").datebox('getValue')

     2.$("input[name='mydate']").val()

    参考:http://www.cnblogs.com/iyangyuan/p/3358239.html

    二,赋值(赋当前时间)

    //获取当前日期并格式化
    function getNowFormatDate() {
      var date = new Date();
      var seperator1 = "-";
      var seperator2 = ":";
      var month = date.getMonth() + 1;
      var strDate = date.getDate();
      if (month >= 1 && month <= 9) {
           month = "0" + month;
      }
      if (strDate >= 0 && strDate <= 9) {
      strDate = "0" + strDate;
      }
      var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
      return currentdate.toString();
    }

     //页面初始化

     $(function () { 

        $("#PurDate").datebox('setValue', getNowFormatDate());

     });

     参考:http://www.cnblogs.com/caiyezi/p/6184013.html

     

  • 相关阅读:
    Remove Element
    C++ 一些STL
    Two Pointers/hash/3Sum/4Sum类题目
    动态规划
    UVa 12657 双向链表
    并行运行环境
    多线程编程
    HTML XML CSS JS 迅速学习
    UVa 11988 数组模拟链表
    静态链表
  • 原文地址:https://www.cnblogs.com/weimingxin/p/6785093.html
Copyright © 2011-2022 走看看