Skip to content

Commit

Permalink
Add min date
Browse files Browse the repository at this point in the history
  • Loading branch information
FSadrieh committed Nov 25, 2024
1 parent 1c2a43b commit 0051d8e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions evap/evaluation/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,19 +210,6 @@
setupForms();
</script>

<script type="text/javascript">
document.querySelectorAll("[data-earliest-possible-date]").forEach(element => {
element.addEventListener("change", () => {
if (element.value < element.dataset.earliestPossibleDate) {
element.setCustomValidity(element.dataset.earliestPossibleDateReason);
} else {
element.setCustomValidity("");
}
});
element.dispatchEvent(new Event("change"));
});
</script>

{% block additional_javascript %}{% endblock %}
</body>
</html>
2 changes: 1 addition & 1 deletion evap/staff/templates/staff_semester_view_evaluation.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
<div slot="extra-inputs">
<label>
{% translate 'Exam Date:' %}
<input type="date" name="exam_date" data-earliest-possible-date="{{ evaluation.earliest_possible_exam_date }}" data-earliest-possible-date-reason="{% translate 'The end date of the main evaluation would be before its start date.' %}" class="form-control" required form="exam_creation_form_{{ evaluation.id }}"/>
<input type="date" name="exam_date" min="{{ evaluation.earliest_possible_exam_date }}" class="form-control" required form="exam_creation_form_{{ evaluation.id }}"/>
</label>
</div>

Expand Down

0 comments on commit 0051d8e

Please sign in to comment.