mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 13:27:31 -08:00
fix(RSS Feed Trigger Node): Use newest date instead of first item for new items (#9182)
Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
This commit is contained in:
parent
a591f63e3f
commit
7236a558b9
|
@ -76,7 +76,10 @@ export class RssFeedReadTrigger implements INodeType {
|
||||||
returnData.push(item);
|
returnData.push(item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
pollData.lastItemDate = feed.items[0].isoDate;
|
const maxIsoDate = feed.items.reduce((a, b) =>
|
||||||
|
new Date(a.isoDate as string) > new Date(b.isoDate as string) ? a : b,
|
||||||
|
).isoDate;
|
||||||
|
pollData.lastItemDate = maxIsoDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(returnData) && returnData.length !== 0) {
|
if (Array.isArray(returnData) && returnData.length !== 0) {
|
||||||
|
|
Loading…
Reference in a new issue