n8n/packages/nodes-base/nodes/DateTime/DateTime.node.ts
Michael Kret aea3c50131
feat(Date & Time Node): Option to include other fields in output item (#7661)
Github issue / Community forum post (link here to close automatically):
Community:
https://community.n8n.io/t/date-time-deletes-incoming-props/27492/3
GH Issue: https://github.com/n8n-io/n8n/issues/7646

---------

Co-authored-by: Marcus <marcus@n8n.io>
2023-11-09 17:57:33 +02:00

27 lines
780 B
TypeScript

import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';
import { VersionedNodeType } from 'n8n-workflow';
import { DateTimeV1 } from './V1/DateTimeV1.node';
import { DateTimeV2 } from './V2/DateTimeV2.node';
export class DateTime extends VersionedNodeType {
constructor() {
const baseDescription: INodeTypeBaseDescription = {
displayName: 'Date & Time',
name: 'dateTime',
icon: 'fa:clock',
group: ['transform'],
defaultVersion: 2,
description: 'Allows you to manipulate date and time values',
subtitle: '={{$parameter["action"]}}',
};
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
1: new DateTimeV1(baseDescription),
2: new DateTimeV2(baseDescription),
};
super(nodeVersions, baseDescription);
}
}