文档库--导入修改
This commit is contained in:
+11
-9
@@ -654,15 +654,17 @@ public class DateUtils extends PropertyEditorSupport {
|
||||
* @Return: boolean
|
||||
*/
|
||||
public static boolean isValidDate(String str){
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String[] strArr = str.split(",");
|
||||
for (String dateStr : strArr) {
|
||||
String replace = dateStr.replace("/", "-");
|
||||
try {
|
||||
simpleDateFormat.setLenient(false);
|
||||
simpleDateFormat.parse(replace);
|
||||
} catch (Exception e){
|
||||
return false;
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(str)){
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String[] strArr = str.split(",");
|
||||
for (String dateStr : strArr) {
|
||||
String replace = dateStr.replace("/", "-");
|
||||
try {
|
||||
simpleDateFormat.setLenient(false);
|
||||
simpleDateFormat.parse(replace);
|
||||
} catch (Exception e){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user