Bug687修正(日付指定に値非対応時エラー表示ないBug)

This commit is contained in:
王玉
2024-09-26 15:09:33 +09:00
parent 886969e941
commit 9ddd3783f6

View File

@@ -56,7 +56,10 @@ export class DateSpecifiedAction implements IAction {
let verNameGetValue = getContextVarByPath(context.variables,this.props.verNameGet);
////////////////////////////////////////////////////////////////////////////////////////////////
//取得変数の値Dateオブジェクトに変換
let dateObj = new Date(verNameGetValue);
let dateObj = new Date(verNameGetValue);
if(verNameGetValue === undefined || verNameGetValue === null || verNameGetValue === '' || isNaN(dateObj.getDate())){
throw new Error("Invalid time value");
}
// 年の設定newYearが設定されていない場合は、元の値を使用
dateObj.setFullYear(this.props.newYear >=1900 && this.props.newYear <=9999 ? this.props.newYear : dateObj.getFullYear());
// 月の設定newMonthが設定されていない場合は、元の値を使用// 月は0始まりなので、12月は11。