mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
🐛 Fix bug filtering date and datetime fields on Salesforce node (#2565)
This commit is contained in:
parent
7efb73053d
commit
6066b6670e
|
@ -146,7 +146,7 @@ export function getConditions(options: IDataObject) {
|
|||
const conditions = (options.conditionsUi as IDataObject || {}).conditionValues as IDataObject[];
|
||||
let data = undefined;
|
||||
if (Array.isArray(conditions) && conditions.length !== 0) {
|
||||
data = conditions.map((condition: IDataObject) => `${condition.field}${(condition.operation) === 'equal' ? '=' : condition.operation}${getValue(condition.value)}`);
|
||||
data = conditions.map((condition: IDataObject) => `${condition.field} ${(condition.operation) === 'equal' ? '=' : condition.operation} ${getValue(condition.value)}`);
|
||||
data = `WHERE ${data.join(' AND ')}`;
|
||||
}
|
||||
return data;
|
||||
|
@ -191,7 +191,9 @@ export function getQuery(options: IDataObject, sobject: string, returnAll: boole
|
|||
}
|
||||
|
||||
export function getValue(value: any) { // tslint:disable-line:no-any
|
||||
if (typeof value === 'string') {
|
||||
if (moment(value).isValid()) {
|
||||
return value;
|
||||
} else if (typeof value === 'string') {
|
||||
return `'${value}'`;
|
||||
} else {
|
||||
return value;
|
||||
|
|
Loading…
Reference in a new issue