Skip to content

Commit

Permalink
fix(max): allow scraping older transactions (#895)
Browse files Browse the repository at this point in the history
  • Loading branch information
whatuserever authored Feb 2, 2025
1 parent 62a7919 commit f4fd6b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/scrapers/max.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,9 @@ function prepareTransactions(txns: Transaction[], startMoment: moment.Moment, co
async function fetchTransactions(page: Page, options: ScraperOptions) {
const futureMonthsToScrape = options.futureMonthsToScrape ?? 1;
const defaultStartMoment = moment().subtract(1, 'years');
const startMomentLimit = moment().subtract(4, 'years');
const startDate = options.startDate || defaultStartMoment.toDate();
const startMoment = moment.max(defaultStartMoment, moment(startDate));
const startMoment = moment.max(startMomentLimit, moment(startDate));
const allMonths = getAllMonthMoments(startMoment, futureMonthsToScrape);

await loadCategories(page);
Expand Down

0 comments on commit f4fd6b5

Please sign in to comment.