| | |
| | | /** |
| | | * 比较第一个时间值和第二个时间值的大小 如果第一个大 返回true 否则返回false |
| | | * **/ |
| | | compareDate:function(datebegin,dateend) |
| | | { |
| | | compareDate: function (datebegin, dateend) { |
| | | var datebegindate=dateUtil.strTurnDate(datebegin); |
| | | var dateenddate=dateUtil.strTurnDate(dateend); |
| | | if (datebegindate > dateenddate) { |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | }, |
| | | /*** |
| | | * 获取今天的时间字符串 |
| | | */ |
| | | getNowDate:function() |
| | | { |
| | | getNowDate: function () { |
| | | var dayTime = new Date(); |
| | | dayTime.setTime(dayTime.getTime()); |
| | | return dayTime.getFullYear()+"-" + (dayTime.getMonth()+1) + "-" + dayTime.getDate(); |
| | |
| | | }else{ |
| | | return "Param error,date type!"; |
| | | } |
| | | }, |
| | | /** |
| | | * 判断一个字符串是否日期 |
| | | * @param {字符串} strDate |
| | | */ |
| | | isDate: function (strDate) { |
| | | if (!strUtil.isEmpty(strDate) && !isNaN(Date.parse(strDate))) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | }; |
| | | |