标签:blog io java for div on log cti ad
/** 
         * statics 可以包含类的静态和静态方法,但是不能被子类继承 
         * inheritableStatics 与statics类似但是可以被子类继承 
         */  
 		Ext.onReady(function(){
 			Ext.define(‘DateUtil‘,{
                inheritableStatics:{
                    currentDate : Ext.Date.format(new Date(),‘Y-m-d‘),
                    getCurrentDate:function(formatStr){
                        if (Ext.isString(formatStr)) {
                            Ext.Date.format(new Date(), formatStr);
                        }else{
                            return this.currentDate;
                        }
                    }
                }
            })
 			
            
            //alert(DateUtil.currentDate);
 		    Ext.define(‘TimeUtil‘,{
                extend:‘DateUtil‘,
                statics:{
                    currentTime : Ext.Date.format(new Date(),‘Y-m-d H:i:s‘),
                }
            });
            alert(TimeUtil.currentDate);
            alert(TimeUtil.currentTime);
        });
标签:blog io java for div on log cti ad
原文地址:http://www.cnblogs.com/shaoshao/p/4103951.html