parent
5b1d41eb58
commit
4d56b40c5a
1 changed files with 8 additions and 7 deletions
|
@ -176,7 +176,7 @@
|
|||
|
||||
if (id) {
|
||||
$.get(`/admin/event/${id}`, (data) => {
|
||||
console.log(data)
|
||||
|
||||
if (data.status == "error") {
|
||||
// This is a new event, do nothing!
|
||||
} else {
|
||||
|
@ -190,22 +190,19 @@
|
|||
var month = ("0" + (start.getMonth() + 1)).slice(-2);
|
||||
|
||||
start_day = start.getFullYear()+"-"+(month)+"-"+(day);
|
||||
console.log(start_day)
|
||||
start_time = start.toLocaleTimeString()
|
||||
console.log(start_time)
|
||||
start_time = `${start.getHours()}:${padTwoDigits(start.getMinutes())}`
|
||||
end = new Date(data.end_time)
|
||||
|
||||
var day = ("0" + end.getDate()).slice(-2);
|
||||
var month = ("0" + (end.getMonth() + 1)).slice(-2);
|
||||
|
||||
end_day = end.getFullYear()+"-"+(month)+"-"+(day);
|
||||
end_time = `${end.getHours()}:${end.getMinutes()}`
|
||||
end_time = `${end.getHours()}:${padTwoDigits(end.getMinutes())}`
|
||||
}
|
||||
|
||||
modal.find('#name').val(name)
|
||||
modal.find('#location').val(loc)
|
||||
modal.find('#description').val(description)
|
||||
console.log(start_day)
|
||||
modal.find('#start_day').val(start_day)
|
||||
modal.find('#start_time').val(start_time)
|
||||
modal.find('#end_day').val(end_day)
|
||||
|
@ -223,6 +220,10 @@
|
|||
$('#editModal').on('hidden.bs.modal', function(event) {
|
||||
location.reload()
|
||||
});
|
||||
|
||||
function padTwoDigits(num) {
|
||||
return num.toString().padStart(2, '0')
|
||||
}
|
||||
</script>
|
||||
{% endblock app_content %}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue