Merge pull request 'hotfix27.01' (#18) from hotfix27.01 into main

Reviewed-on: #18
26-10-Jahreswechsel
Samuel Zielke 6 days ago
commit bdf1ba261f

@ -244,7 +244,7 @@ function filterEntriesByMonthYear(month, year) {
const matchesMonth = month ? entryDate.getMonth() + 1 === month : true; // +1 da getMonth() 0-basiert ist
if (entryDate.getMonth() + 1 >= 9){
actualYear = actualYear - 1;
actualYear = actualYear - 0;
} else {
actualYear = actualYear;
};

@ -39,7 +39,13 @@ mins.addEventListener('input', () => {
})
document.getElementById('sonstigesInput').addEventListener('input', () => {
checkInput();
})
})
// Button-Status beim Öffnen des Modals einmal anhand der Standardwerte (z.B. Minuten = 0) setzen,
// da sonst ohne ein tatsächliches 'input'-Event der Button trotz gültiger Vorbelegung deaktiviert bleibt
document.getElementById('newEntryModal').addEventListener('show.bs.modal', () => {
checkInput();
})
// Einstellungen wenn Neuer Eintrag erstellt wird
NewEntryButton.addEventListener('click', () => {
@ -58,8 +64,8 @@ NewEntryButton.addEventListener('click', () => {
sonstigesText.style.display = 'none';
}
// Berechnen der Duration
const duration = (parseInt(hours.value)*60) + parseInt(mins.value)
// Berechnen der Duration (Stunden sind optional -> ohne Eingabe wird 0 gespeichert)
const duration = ((parseInt(hours.value) || 0)*60) + parseInt(mins.value)
const newEntryData = {
date: document.getElementById('datum').value,
@ -326,7 +332,7 @@ document.getElementById('editEntrySubmitButton').addEventListener('click', () =>
updateEntry(parseInt(ToEditID), 'hours', {
date: document.getElementById('editDatum').value,
duration: (parseInt(edithours.value)*60) + parseInt(editMins.value),
duration: ((parseInt(edithours.value) || 0)*60) + parseInt(editMins.value),
type: type,
status: 1,
sondertext: document.getElementById('editsonstigesInput').value,
@ -438,7 +444,7 @@ function checkInput() {
if ((sonstigesCheck.checked && sonstigesInput.value !== "") || !(sonstigesCheck.checked)) {
// Debug Ausgabe für Bedingungsstufen
// console.log("Erste Bedingung: TRUE")
if (hours.value && mins.value) {
if (mins.value) { // Stunden sind optional, Minuten bleiben Pflicht
// Debug Ausgabe für Bedingungsstufen
// console.log("Zweite Bedingung: TRUE")
if (!allowToSend) {
@ -478,7 +484,7 @@ function checkEditInput() {
if ((editsonstigesCheck.checked && editsonstigesInput.value !== "") || !(editsonstigesCheck.checked)) {
// Debug Ausgabe für Bedingungsstufen
// console.log("Erste Bedingung: TRUE")
if (edithours.value && editMins.value) {
if (editMins.value) { // Stunden sind optional, Minuten bleiben Pflicht
// Debug Ausgabe für Bedingungsstufen
// console.log("Zweite Bedingung: TRUE")
if (!editallowToSend) {

@ -148,7 +148,7 @@
<div class="form-group col-7">
<p><b>Dauer</b></p>
<div class="input-group">
<input type="number" class="form-control" id="stunden" placeholder="00" min="0" max="99" maxlength="2" required>
<input type="number" class="form-control" id="stunden" placeholder="00" min="0" max="99" maxlength="2">
<div class="input-group-append">
<span class="input-group-text">h</span>
</div>
@ -215,7 +215,7 @@
<div class="form-group col-7">
<p><b>Dauer</b></p>
<div class="input-group">
<input type="number" class="form-control editItem" id="editStunden" placeholder="00" min="0" max="99" maxlength="2" required>
<input type="number" class="form-control editItem" id="editStunden" placeholder="00" min="0" max="99" maxlength="2">
<div class="input-group-append">
<span class="input-group-text">h</span>
</div>

@ -1,5 +1,5 @@
asgiref==3.8.1
Django==5.1.1
Django==5.2.17
django-pwa==2.0.0
gunicorn==23.0.0
mysqlclient==2.2.4

Loading…
Cancel
Save

Powered by TurnKey Linux.