mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
⚡ Add parameter include time when setting field type date on Notion node (#1879)
* ⚡ Add parameter include time when setting field type date Fixes issue #1878 * Fix issue with date format
This commit is contained in:
@@ -270,15 +270,14 @@ function getPropertyKeyValue(value: any, type: string, timezone: string) {
|
||||
};
|
||||
break;
|
||||
case 'date':
|
||||
//&& value.dateStart !== 'Invalid date' && value.dateEnd !== 'Invalid date'
|
||||
const format = getDateFormat(value.includeTime);
|
||||
if (value.range === true) {
|
||||
result = {
|
||||
type: 'date', date: { start: moment.tz(value.dateStart, timezone).utc().format(), end: moment.tz(value.dateEnd, timezone).utc().format() },
|
||||
type: 'date', date: { start: moment.tz(value.dateStart, timezone).format(format), end: moment.tz(value.dateEnd, timezone).format(format) },
|
||||
};
|
||||
//if (value.date !== 'Invalid date')
|
||||
} else {
|
||||
result = {
|
||||
type: 'date', date: { start: moment.tz(value.date, timezone).utc().format(), end: null },
|
||||
type: 'date', date: { start: moment.tz(value.date, timezone).format(format), end: null },
|
||||
};
|
||||
}
|
||||
break;
|
||||
@@ -287,6 +286,13 @@ function getPropertyKeyValue(value: any, type: string, timezone: string) {
|
||||
return result;
|
||||
}
|
||||
|
||||
function getDateFormat(includeTime: boolean) {
|
||||
if (includeTime === false) {
|
||||
return 'yyyy-MM-DD';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function getNameAndType(key: string) {
|
||||
const [name, type] = key.split('|');
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user