Skip to content

Commit

Permalink
fix(RSS Feed Trigger Node): Use newest date instead of first item for…
Browse files Browse the repository at this point in the history
… new items (#9182)

Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
  • Loading branch information
meownoid and Joffcom authored May 22, 2024
1 parent a591f63 commit 7236a55
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ export class RssFeedReadTrigger implements INodeType {
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) {
Expand Down

0 comments on commit 7236a55

Please sign in to comment.