fix front

This commit is contained in:
Николай 2023-05-19 11:36:34 +04:00
parent 5bd38a465f
commit 38f53ae91e

View File

@ -20,10 +20,10 @@
<p class="mb-0">Дата конца:</p> <p class="mb-0">Дата конца:</p>
<input id="date-to-input" class="form-control" type="date" /> <input id="date-to-input" class="form-control" type="date" />
</div> </div>
<button id="generate-button" class="button-primary text-button mb-2"> <button id="generate-button" class="btn btn-primary mb-2">
Показать Показать
</button> </button>
<button id="send-by-mail-button" class="btn btn-primary text-button mb-2"> <button id="send-by-mail-button" class="btn btn-primary mb-2">
На почту На почту
</button> </button>
</div> </div>
@ -34,7 +34,7 @@
<span>&nbsp;по&nbsp;</span> <span>&nbsp;по&nbsp;</span>
<span id="date-to-span" class="fw-bold">...</span> <span id="date-to-span" class="fw-bold">...</span>
</p> </p>
<div class="table-shell mb-2 border"> <div class="mb-2 border">
<table class="table mb-0"> <table class="table mb-0">
<thead class="table-head"> <thead class="table-head">
<tr> <tr>
@ -106,14 +106,6 @@
}); });
}); });
dateFromInput.addEventListener("input", () => {
errorDivShell.style.gridTemplateRows = "0fr";
});
dateToInput.addEventListener("input", () => {
errorDivShell.style.gridTemplateRows = "0fr";
});
// ![Event listeners] // ![Event listeners]
// [HTML gen] // [HTML gen]
@ -169,17 +161,14 @@
const validate = function (reportModel) { const validate = function (reportModel) {
if (isNaN(reportModel["DateFrom"])) { if (isNaN(reportModel["DateFrom"])) {
errorDivShell.style.gridTemplateRows = "1fr";
errorP.innerHTML = "Выберите начальную дату"; errorP.innerHTML = "Выберите начальную дату";
return false; return false;
} }
if (isNaN(reportModel["DateTo"])) { if (isNaN(reportModel["DateTo"])) {
errorDivShell.style.gridTemplateRows = "1fr";
errorP.innerHTML = "Выберите конечную дату"; errorP.innerHTML = "Выберите конечную дату";
return false; return false;
} }
if (reportModel["DateFrom"] >= reportModel["DateTo"]) { if (reportModel["DateFrom"] >= reportModel["DateTo"]) {
errorDivShell.style.gridTemplateRows = "1fr";
errorP.innerHTML = "Начальная дата должна быть меньше конечной"; errorP.innerHTML = "Начальная дата должна быть меньше конечной";
return false; return false;
} }