zoukankan      html  css  js  c++  java
  • 工作笔记(一)

    1. 在datagrid上添加“查询”按钮,对datagrid列出的数据进一步筛选。

    “查询”按钮触发的事件:

    //获取筛选的数据值
    
    var colNameSearch = $('#colNameSearch').val();
    
    //调用datagrid的方法
    
    $('#communityManage').datagrid('load',{
    
    colName :colNameSearch   //参数
    
    });

    2 . 对日期进行格式化,网上看到的,感觉不错,放在此处以防忘记:

    /*
     * 为Date添加一个formatDate,用来格式化日期
     * 
     * yyyy 年
     * MM 月
     * dd 日
     * hh 小时
     * mm 分
     * ss 秒
     * qq 季度
     * S  毫秒
     * 
     * format:yyyy-
     * 
     * cnfengqinag  2015-04-07
     */
    Date.prototype.formatDate = function (format) 
    {
        var o = {
            "M+": this.getMonth() + 1, //month
            "d+": this.getDate(),    //day
            "h+": this.getHours(),   //hour
            "m+": this.getMinutes(), //minute
            "s+": this.getSeconds(), //second
            "q+": Math.floor((this.getMonth() + 3) / 3),  //quarter
            "S": this.getMilliseconds() //millisecond
        };
        if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
        (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o) if (new RegExp("(" + k + ")").test(format))
            format = format.replace(RegExp.$1,
          RegExp.$1.length == 1 ? o[k] :
            ("00" + o[k]).substr(("" + o[k]).length));
        return format;
    };

    对于一个使用毫秒来标记的日期,可做如下转换,得到一个时间对象:

    var unixTimestamp = new Date(value);

    3 . 发现的错误,数据库中的datatime类型对应到Java中的类型是java.sql.Timestamp,

    今天同事使用的Date对应,在保存日期时报错。

  • 相关阅读:
    设计模式之工厂模式大后期
    Net基础恶补
    TPL异步并行编程之回调
    Net线程安全集合
    【记录贴】树的深度最优路径分析 [ 未完全版 ] 【原】
    java生产环境增量发版陷阱【原】
    expdp和impdp导入导出用法【转】
    exp和imp导入导出时表空间问题【未完】
    linux xargs【转】
    windows cmd命令 批处理bat 导增量jar包【原】
  • 原文地址:https://www.cnblogs.com/haoke/p/4399377.html
Copyright © 2011-2022 走看看