n8n/packages/nodes-base/nodes/DateTime/DateTime.node.ts

28 lines
781 B
TypeScript
Raw Normal View History

2023-04-04 05:45:06 -07:00
import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';
import { VersionedNodeType } from 'n8n-workflow';
import { DateTimeV1 } from './V1/DateTimeV1.node';
import { DateTimeV2 } from './V2/DateTimeV2.node';
2023-04-04 05:47:21 -07:00
export class DateTime extends VersionedNodeType {
2023-04-04 05:45:06 -07:00
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);
2020-01-23 16:07:18 -08:00
}
}