JavaScript syntax: bucketing based on days (today, yesterday and past)
Doing it without an additional library you could try a custom function that does the same thing
function isSame(a,offset) {
    const b = new Date();
    b.setDate(b.getDate() - offset); 
    return a === b
}

const [todayBucket, yesterdayBucket] = [0, 1].map(offset =&gt;
  recordings.filter(({ createdOn }) =&gt;
    isSame(createdOn,offset),
  ),
);
const pastBucket = recordings.filter(
  recording =&gt; ![...todayBucket, ...yesterdayBucket].includes(recording),
);