Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypnos3 committed Sep 13, 2021
1 parent 8d6df5b commit 1093fc5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nodes/lib/dateTimeHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,12 @@ function getFormattedDateOut(date, format, utc, timeZoneOffset) {
}
format = format || 0;
if (date.value) { date = date.value; }
if (!(date instanceof Date)) { date = Date(date); }
if (!(date instanceof Date)) {
date = Date(date);
if (!isValidDate(date)) {
throw new Error(`given Date is not a valid Date!!`);
}
}

if (isNaN(format)) {
return _dateFormat(date, String(format), utc, timeZoneOffset);
Expand Down

0 comments on commit 1093fc5

Please sign in to comment.