文档库--导入修改

This commit is contained in:
zhn
2022-03-09 19:02:03 +08:00
parent b7129e4def
commit 643cd72daa
2 changed files with 38 additions and 9 deletions
@@ -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;