🐛 Fix bug that fromFormat field did not get used in pre-check #712

This commit is contained in:
Jan Oberhauser 2020-06-30 20:30:14 +02:00
parent 872bc9df75
commit fc4ebfedca

View file

@ -243,9 +243,10 @@ export class DateTime implements INodeType {
if (currentDate === undefined) {
continue;
}
if (!moment(currentDate as string | number).isValid()) {
if (options.fromFormat === undefined && !moment(currentDate as string | number).isValid()) {
throw new Error('The date input format could not be recognized. Please set the "From Format" field');
}
if (Number.isInteger(currentDate as unknown as number)) {
newDate = moment.unix(currentDate as unknown as number);
} else {