Split an array of items into several arrays, given a condition
Always create a function
Its not really code if its not a function, you may as well just output the 3 arrays directly. (my personal view on global inline code).
You may say, &quot;This is just an example&quot;. No it can not be just an example, a function has special powers and is written differently than inline code. Plus examples are boarder line off topic here, this question may get closed.
Part of a functions power is that it makes you think about how you solve the problem differently from inline code.
Look for change
When you write a function you look for the parts of the logic and data that change. You pass that to the function as arguments. The function uses these argument to process the data and return the desired results.
In this case you have

the array of items to split.
The number of days old to split the data, eg 1,2,and 7 days.

Thus we can have something like the following. The function is declared inside another so that all it needs is safely encapsulated and outside of unrelated scopes.
const splitByDaysOld = (() =&gt; {
    const MS_IN_DAY = 8.64e7;
    const sorter = (a, b) =&gt; a - b;
    return function(array, periods) {
        const now = Date.now();
        var start = 0;
        return periods.sort(sorter).map(day =&gt; {
            const res = array.filter(item =&gt; {
                const daysOld = (item.date - now) / MS_IN_DAY;
                return daysOld &gt;= start &amp;&amp; daysOld &lt; day;
            });
            start = day;
            return res;
        });
    };
})();
            

It returns an array of arrays, one for each period.
Example below has 3 periods  0 to &lt; 1, 1 to &lt; 2, and 2 to &lt; 7 days old.
const [today, yesterday, week] = splitByDaysOld(arr, [1, 2, 7]);

Note that the periods array is sorted from most recent to oldest and that the result will be in the same order