mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
🐛 Fix bug that fromFormat field did not get used in pre-check #712
This commit is contained in:
parent
872bc9df75
commit
fc4ebfedca
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue