HotReboot,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script>
var dates = [
['2021-08-15', '2021-08-20'],
['2021-09-01', '2021-09-05'],
]
var data = '2021-08-25',
bigdata;
function time(d) {
d = new Date(d);
d.setHours(0, 0, 0, 0);
return d
}
var dd = time(data);
k: for (let [a, b] of dates) {
[a, b] = [a, b].map(time);
for (; a < b; a.setHours(24, 0, 0, 0)) {
if (+a > +dd) {
bigdata = a;
break k;
}
}
}
if (bigdata) bigdata = $.datepicker.formatDate("yy-mm-dd", bigdata);
alert(bigdata)
</script>
</head>
<body>
</body>
</html>