Или по какой-то общей части id
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flatpickr/4.5.1/flatpickr.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/flatpickr/4.5.1/flatpickr.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
flatpickr('[id*="_datetime_"]', {
"disable": [
function (date) {
// return true to disable
return (date.getDay() != 5 && date.getDay() != 6);
}
],
"locale": {
"firstDayOfWeek": 1 // start week on Monday
}
});
});
</script>
</head>
<body>
<input id="form1_datetime_218294727" type="text" placeholder="Select Date..">
<input id="form4_datetime_212222222" type="text" placeholder="Select Date..">
</body>
</html>