Index: ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationLookView.js =================================================================== diff -u -r36793 -r36794 --- ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationLookView.js (.../storageLocationLookView.js) (revision 36793) +++ ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationLookView.js (.../storageLocationLookView.js) (revision 36794) @@ -87,13 +87,27 @@ } function compareDate(DateOne,DateTwo) { - var OneMonth = DateOne.substring(5,DateOne.lastIndexOf ("-")); - var OneDay = DateOne.substring(DateOne.length,DateOne.lastIndexOf ("-")+1); - var OneYear = DateOne.substring(0,DateOne.indexOf ("-")); - var TwoMonth = DateTwo.substring(5,DateTwo.lastIndexOf ("-")); - var TwoDay = DateTwo.substring(DateTwo.length,DateTwo.lastIndexOf ("-")+1); - var TwoYear = DateTwo.substring(0,DateTwo.indexOf ("-")); - if (Date.parse(OneMonth+"/"+OneDay+"/"+OneYear) >= Date.parse(TwoMonth+"/"+TwoDay+"/"+TwoYear)) { + var newDateOne; + var newDateTwo; + if(DateOne.indexOf('-') >= 0){ + var OneMonth = DateOne.substring(5,DateOne.lastIndexOf ("-")); + var OneDay = DateOne.substring(DateOne.length,DateOne.lastIndexOf ("-")+1); + var OneYear = DateOne.substring(0,DateOne.indexOf ("-")); + newDateOne = OneMonth+"/"+OneDay+"/"+OneYear; + }else { + newDateOne = DateOne; + } + + if(DateTwo.indexOf('-') >= 0){ + var TwoMonth = DateTwo.substring(5,DateTwo.lastIndexOf ("-")); + var TwoDay = DateTwo.substring(DateTwo.length,DateTwo.lastIndexOf ("-")+1); + var TwoYear = DateTwo.substring(0,DateTwo.indexOf ("-")); + newDateTwo = TwoMonth+"/"+TwoDay+"/"+TwoYear; + }else { + newDateTwo = DateTwo; + } + + if (Date.parse(newDateOne) >= Date.parse(newDateTwo)) { return true;//dataone>datetwo } else { return false;