mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-23 11:44:06 -08:00
⚡ Add support for moment types to If Node
This commit is contained in:
parent
37930057d8
commit
119989bc37
|
@ -1,3 +1,4 @@
|
|||
import moment = require('moment');
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
import {
|
||||
INodeExecutionData,
|
||||
|
@ -333,6 +334,8 @@ export class If implements INodeType {
|
|||
returnValue = new Date(value).getTime();
|
||||
} else if (typeof value === 'number') {
|
||||
returnValue = value;
|
||||
} if (moment.isMoment(value)) {
|
||||
returnValue = value.unix();
|
||||
} if ((value as unknown as object) instanceof Date) {
|
||||
returnValue = (value as unknown as Date).getTime();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue