Bugfix Inputform

Bugfix for the start and enddate
This commit is contained in:
AliGitGut
2023-06-14 12:24:20 +02:00
parent eb69b97b9d
commit cff384f5b4
+3 -4
View File
@@ -31,7 +31,6 @@ export default function InputForm(p) {
let sessionid = localStorage.getItem("sessionid"); let sessionid = localStorage.getItem("sessionid");
let url = baseURL + "/users/all?sessionid=" + sessionid; let url = baseURL + "/users/all?sessionid=" + sessionid;
await fetch(url).then(response => response.json()).then(async user => { await fetch(url).then(response => response.json()).then(async user => {
setUsers(user) setUsers(user)
let mURL = baseURL + "/module/suid?sessionid=" + localStorage.getItem("sessionid") + "&semesterid=" + localStorage.getItem("currentsid") + "&userid="; let mURL = baseURL + "/module/suid?sessionid=" + localStorage.getItem("sessionid") + "&semesterid=" + localStorage.getItem("currentsid") + "&userid=";
@@ -312,14 +311,14 @@ export default function InputForm(p) {
<input type="date" id="start" className={"box-shadow selector"} value={startDate} <input type="date" id="start" className={"box-shadow selector"} value={startDate}
style={{ style={{
padding: 5, padding: 5,
backgroundColor: (startDate != "" && endDate != "" && startDate >= endDate) ? "#E44747" : "white" backgroundColor: (startDate == "" || startDate >= endDate) ? "#E44747" : "white"
}} }}
onChange={(e) => setStartDate(e.target.value)}/> onChange={(e) => setStartDate(e.target.value)}/>
<p className="inputFieldSeperator">-</p> <p className="inputFieldSeperator">-</p>
<input type="date" id="start" className={"box-shadow selector"} value={endDate} <input type="date" id="start" className={"box-shadow selector"} value={endDate}
style={{ style={{
padding: 5, padding: 5,
backgroundColor: (startDate != "" && endDate != "" && startDate >= endDate) ? "#E44747" : "white" backgroundColor: (endDate == "" || startDate >= endDate) ? "#E44747" : "white"
}} }}
onChange={(e) => setEndDate(e.target.value)}/> onChange={(e) => setEndDate(e.target.value)}/>
</div> </div>
@@ -403,7 +402,7 @@ export default function InputForm(p) {
<Button color="rgba(54,54,54,0.64)" width="100px" height="30px" text="Abbrechen" onClick={() => { <Button color="rgba(54,54,54,0.64)" width="100px" height="30px" text="Abbrechen" onClick={() => {
router.back() router.back()
}}/> }}/>
<Button color="#77932b" width="100px" height="30px" text="Speichern" onClick={() => { startDate >= endDate ? () => {} : onCreateClicked()} <Button color="#77932b" width="100px" height="30px" text="Speichern" onClick={() => { (startDate == "" || endDate == ""|| startDate >= endDate) ? () => {} : onCreateClicked()}
}/> }/>
</div> </div>
</div> </div>