auto format-fix

This commit is contained in:
Karsten Siegmund 2024-01-26 11:07:56 +01:00
parent fc5c15a2c8
commit ae656679b0
2 changed files with 19 additions and 17 deletions

View File

@ -195,8 +195,7 @@ echo "<p><noscript><button name='ShowSchichten' value='1'>Schichten Anzeigen</bu
// Aktueller Dienst und dessen Schichten Anzeigen // Aktueller Dienst und dessen Schichten Anzeigen
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
if( !isset($DienstID)) if (!isset($DienstID)) {
{
echo "<img src='Bilder/Attention_Sign.svg' width='20px'> Bitte erst Dienst Auswählen </body></html>"; echo "<img src='Bilder/Attention_Sign.svg' width='20px'> Bitte erst Dienst Auswählen </body></html>";
exit; exit;
} }
@ -351,12 +350,16 @@ echo "<p><noscript><button name='ShowSchicht' value='1'>Schicht Anzeigen</button
</table> </table>
<input style="width:unset" width=20 id="Schicht-Automatic-Bis" name="Schicht-Automatic-Bis" type="checkbox" onclick="setEndDate()" <?php <input style="width:unset" width=20 id="Schicht-Automatic-Bis" name="Schicht-Automatic-Bis" type="checkbox" onclick="setEndDate()" <?php
if ($AutomaticBis) { echo "checked";} if ($AutomaticBis) {
?> > Endzeit von Dauer<br> echo "checked";
}
?> > Endzeit von Dauer<br>
<input style="width:unset" width=20 id="Schicht-Anschlussschicht" name="Schicht-Anschlussschicht" type="checkbox" <?php <input style="width:unset" width=20 id="Schicht-Anschlussschicht" name="Schicht-Anschlussschicht" type="checkbox" <?php
if ($Anschlussschicht) { echo "checked"; } if ($Anschlussschicht) {
?> > Anschlussschicht vorbereiten<br> echo "checked";
}
?> > Anschlussschicht vorbereiten<br>
<p> <p>
<button name="NewSchicht" value="1">Schicht anlegen</button> <button name="NewSchicht" value="1">Schicht anlegen</button>
<button name="ChangeSchicht" value="1">Ändern</button> <button name="ChangeSchicht" value="1">Ändern</button>

View File

@ -18,17 +18,16 @@ function setEndDate()
// because maybe browsers also convert to UTC for the internal value // because maybe browsers also convert to UTC for the internal value
// but I guess in the worst case we have ZZ at the end and the js autofill fails // but I guess in the worst case we have ZZ at the end and the js autofill fails
var checkBox = document.getElementById("Schicht-Automatic-Bis"); var checkBox = document.getElementById("Schicht-Automatic-Bis");
if (checkBox.checked == true) if (checkBox.checked == true) {
{ var start = new Date(document.getElementById("Schicht-Von").value + 'Z');
var start = new Date(document.getElementById("Schicht-Von").value+'Z'); var delta = new Date("0000-01-01T" + document.getElementById("Schicht-Dauer").value);
var delta = new Date("0000-01-01T"+ document.getElementById("Schicht-Dauer").value);
var end = new Date(start); var end = new Date(start);
var endHours=start.getHours()+delta.getHours(); var endHours = start.getHours() + delta.getHours();
end.setHours(endHours); end.setHours(endHours);
console.log("Schicht-Von: "+document.getElementById("Schicht-Von").value+'Z'+" Schicht-Dauer: "+"0000-01-01T"+ document.getElementById("Schicht-Dauer").value + "Schicht-Bis: " + end.toISOString().replace(/.000Z/,"")); console.log("Schicht-Von: " + document.getElementById("Schicht-Von").value + 'Z' + " Schicht-Dauer: " + "0000-01-01T" + document.getElementById("Schicht-Dauer").value + "Schicht-Bis: " + end.toISOString().replace(/.000Z/,""));
end.setMinutes(start.getMinutes()+delta.getMinutes()); end.setMinutes(start.getMinutes() + delta.getMinutes());
document.getElementById("Schicht-Bis").value=end.toISOString().replace(/.000Z/,""); document.getElementById("Schicht-Bis").value = end.toISOString().replace(/.000Z/,"");
} }
} }
//// https://www.w3schools.com/howto/howto_js_collapsible.asp //// https://www.w3schools.com/howto/howto_js_collapsible.asp