Skip to content

Commit

Permalink
new incident/event: set automatically to the current time by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Augustin-FL committed Dec 27, 2024
1 parent 3922c85 commit 0ccc5fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions incidents/static/custom_js/new.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$(document).ready(function() {
if ($("#id_date").val() == "") {
var date = new Date();
date = new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000).toISOString().slice(0, 16)
$("#id_date").val(date);
}
});
1 change: 1 addition & 0 deletions incidents/templates/events/new.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

{% block custom_js %}
<script src="{% static "select/select2.min.js" %}"></script>
<script src="{% static "custom_js/new.js" %}"></script>
{% rich_edit_static %}
<script>
$(document).ready(function() {
Expand Down

0 comments on commit 0ccc5fc

Please sign in to comment.