MaxDate

@caromagagna I can’t tell at first glance. Try to add console.log 's after each row and see where the error is.
But I think that in line 2 (refers to your last comment) you should use new Date().
Maybe something like:

let firstTime = new Date($w('#datePicker1').value).getTime();