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