修复time()公式问题
This commit is contained in:
parent
c70a7e5590
commit
f7e6086c87
|
@ -1,5 +1,7 @@
|
|||
package com.auxiliary.datadriven;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import com.auxiliary.tool.data.CarLicecenType;
|
||||
import com.auxiliary.tool.data.MobleNumberType;
|
||||
import com.auxiliary.tool.data.PresetString;
|
||||
|
@ -194,7 +196,19 @@ public class Functions {
|
|||
* @return 返回处理后的时间
|
||||
*/
|
||||
private static String disposeTime(String timeText, String pattern) {
|
||||
return Time.parse(timeText).addTime(pattern).getFormatTime();
|
||||
timeText = Optional.ofNullable(timeText).orElse("");
|
||||
pattern = Optional.ofNullable(pattern).orElse("");
|
||||
|
||||
Time time = Time.parse();
|
||||
if (!timeText.isEmpty()) {
|
||||
time = Time.parse(timeText);
|
||||
}
|
||||
|
||||
if (!pattern.isEmpty()) {
|
||||
time.addTime(pattern);
|
||||
}
|
||||
|
||||
return time.getFormatTime();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue