zoukankan      html  css  js  c++  java
  • 转换时间的显示格式

     //转换时间格式
        function datetimeStrFormat(time) {
    
            var d = new Date(time);
            var times = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
    
            return times;
        }
    

     

     

     function showHjxx() {
            var url = "http://syrk.hubei.gov.cn/api/sfz/PidCardController/listPidCardInfo";
            dg = $("#dg").datagrid({
                url: url,
                method: "post",
                queryParams: {
                    "pid": $("#edpid").textbox('getValue'),
                    "name": $("#edname").textbox('getValue'),
                    "caseId": $("#caseId").textbox('getValue')
                },
                singleSelect: false,
                fitColumns: true,//自适应列宽度,隐藏水平滚动条
                nowrap: true,//不换行,数据一行显示
                pageNumber: 1,
                striped: true,//添加行奇偶条纹
                pagination: true,//显示底部页面导航
                pageList: [10, 20, 50, 100],
                pageSize: 10,
                scrollbarSize: 0,
                rownumbers: true,//显示行序号
                columns: [
                    [
                        {field: "1", checkbox: true},
                        {field: "pid", title: "公民身份号码",  10, align: 'left', halign: 'center'},
                        {field: "name", title: "姓名",  7, align: 'left', halign: 'center'},
                        {field: "gender", title: "性别",  5, align: 'left', halign: 'center'},
                        {field: "dob", title: "出生日期",  10, align: 'left', halign: 'center',
                            formatter:function (value,rowData,rowIndex) {
                                return datetimeStrFormat(value);
                            }
                        },
                        {field: "acceptno", title: "受理号",  18, align: 'left', halign: 'center'},
                        {field: "accetporg", title: "受理单位",  15, align: 'left', halign: 'center'},
                        {field: "acceptdate", title: "受理时间",  10, align: 'left', halign: 'center',
                                formatter:function (value,rowData,rowIndex) {
                                    return datetimeStrFormat(value);
                                }
                        },
                        {field: "tel", title: "联系电话",  10, align: 'left', halign: 'center'},
                        /* {field: 'operate',title: '操作列',   10, align: 'center',
                             formatter: function (value, row, rowIndex) {
                                 var str = '<a name="opera" class="abtn red" onclick="sh( );" ><font color="blue">审核签发</font></a>';
                                 return str;
                             }
                         }*/
                    ]
                ]
            });
        }
  • 相关阅读:
    特征选择(1)
    sklearn.preprocessing.OneHotEncoder
    朴素贝叶斯算法
    机器学习中 生成式模型 VS 判别式模型
    PHP-FPM 多进程模型
    PHP动态模式和静态模式区别
    Nginx的异步非阻塞
    php并发控制 , 乐观锁
    什么是乐观锁,什么是悲观锁
    redis集群和哨兵的区别
  • 原文地址:https://www.cnblogs.com/qianyuhebaobao/p/11097355.html
Copyright © 2011-2022 走看看