zoukankan      html  css  js  c++  java
  • js格式化日期 年月日

        /**
                         * 格式化日期
                         * @param value
                         * @param row
                         * @param index
                         * @returns
                         */
                        function valueFormatterDate(value,row,index){
                            var time = new Date();
                            if(value){
                                if((value+"").indexOf("-")>0){
                                    value=/d{4}-d{1,2}-d{1,2}/g.exec(value);
                                    return value;
                                }
                                time = new Date(value);
                            }
                            var year=time.getFullYear();
                            var month = time.getMonth() + 1;  
                            var day = time.getDate();
                            if(month<10){
                                month="0"+month;
                            }
                            
                            if(day<10){
                                day="0"+day;
                            }
                            
                            return year+"-"+month+"-"+day;
                        }
                       

  • 相关阅读:
    设计模式:备忘录模式(Memento)
    设计模式:中介者模式(Mediator)
    设计模式:迭代器模式(Iterator)
    设计模式:解释器模式(Interpreter)
    设计模式:命令模式(Command)
    设计模式:职责链模式(Chain of Responsibility)
    设计模式:单例模式(单例模式)
    win7硬盘安装方法
    sqlite 附加和分离数据库
    Sqlite 复制表结构和数据
  • 原文地址:https://www.cnblogs.com/ckaifeng/p/5025818.html
Copyright © 2011-2022 走看看