Bugfix Inputform
Bugfix for the start and enddate
This commit is contained in:
@@ -31,7 +31,6 @@ export default function InputForm(p) {
|
||||
let sessionid = localStorage.getItem("sessionid");
|
||||
let url = baseURL + "/users/all?sessionid=" + sessionid;
|
||||
|
||||
|
||||
await fetch(url).then(response => response.json()).then(async user => {
|
||||
setUsers(user)
|
||||
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}
|
||||
style={{
|
||||
padding: 5,
|
||||
backgroundColor: (startDate != "" && endDate != "" && startDate >= endDate) ? "#E44747" : "white"
|
||||
backgroundColor: (startDate == "" || startDate >= endDate) ? "#E44747" : "white"
|
||||
}}
|
||||
onChange={(e) => setStartDate(e.target.value)}/>
|
||||
<p className="inputFieldSeperator">-</p>
|
||||
<input type="date" id="start" className={"box-shadow selector"} value={endDate}
|
||||
style={{
|
||||
padding: 5,
|
||||
backgroundColor: (startDate != "" && endDate != "" && startDate >= endDate) ? "#E44747" : "white"
|
||||
backgroundColor: (endDate == "" || startDate >= endDate) ? "#E44747" : "white"
|
||||
}}
|
||||
onChange={(e) => setEndDate(e.target.value)}/>
|
||||
</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={() => {
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user