Syomga,
<!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>
$(function() {
let clone = $('#line').clone();
initDatepicker('#date');
function initDatepicker(id) {
$(id).datepicker({
showOn: 'focus',
altFormat: "mm.dd.yy",
dateFormat: "mm.dd.yy",
});
}
function cloner() {
clone.clone().appendTo('#action');
let new_date = $('.date');
new_date.each(function(index, value) {
if ($(this).is('.hasDatepicker')) return;
$(this).attr('id', 'date' + index);
initDatepicker(value);
});
}
cloner()
cloner()
cloner()
});
</script>
</head>
<body>
<div id="action">
<div class="row" id="line" style="margin-bottom: 10px;">
<div class="col-md-5">
<input type="text" id="date" class="form-control date" placeholder="Дата" name="new_date[]">
</div>
<div class="col-md-5">
<input type="text" class="form-control" placeholder="Сумма" name="new_sum[]">
</div>
<div class="col-md-2">
<div class="btn-group">
<button type="button" class="btn btn-danger" id="del" onclick="deleteElement()">- Удалить</button>
</div>
</div>
</div>
</div>
</body>
</html>