mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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) {
|
if (currentDate === undefined) {
|
||||||
continue;
|
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');
|
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)) {
|
if (Number.isInteger(currentDate as unknown as number)) {
|
||||||
newDate = moment.unix(currentDate as unknown as number);
|
newDate = moment.unix(currentDate as unknown as number);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue