Change boolean value of other elements in a collection, after a filter

Hi there. I’ve developed a site that show’s an image and some related text each day, changing depending on the date set in the collection. This is done using the code below.

If today’s image is displayed here, it’s boolean value for a field called ‘current’ should be ‘true’, so it is not shown in a separate gallery of ‘Previous Photos’. How can I amend this code to change the ‘current’ field of this image record in the collection to True and the ‘current’ field of all other images in the collection to ‘not true’.

import wixData from 'wix-data';

$w.onReady(function () {
$w("#dataset1").onReady( () => {
let localDate = new Date();
let yearValue = localDate.getFullYear();
let monthValue = localDate.getMonth();
let dayValue = localDate.getDate();
let dateValue1 = new Date(yearValue,monthValue,dayValue,0,0,0);
let dateValue2 = new Date(yearValue,monthValue,dayValue,23,59,59);
$w("#dataset1").setFilter( wixData.filter()
.between('date', dateValue1, dateValue2)

);
});
});

Why didn’t you just mention this as well in your original post from yesterday when you were going through the replies from @tony-brunsman , then it could have possibly been looked at already?
https://www.wix.com/corvid/forum/community-discussion/filter-column-image-based-on-today-s-date

@givemeawhisky I’ve only just realised that it’s an issue now and felt it was a separate question, hence the new post.