Datum Validierung

Start eines Theorie Semester kann nicht hinter dem Ende des Theorie Semesters liegen
This commit is contained in:
AliGitGut
2023-06-14 11:29:31 +02:00
parent c02a0592ed
commit eb69b97b9d
4 changed files with 3681 additions and 13 deletions
+13 -7
View File
@@ -28,7 +28,6 @@ export default function InputForm(p) {
const [modulesNames, setModulesNames] = useState(new Array(100).fill("Please Select")) const [modulesNames, setModulesNames] = useState(new Array(100).fill("Please Select"))
async function getAllUsers() { async function getAllUsers() {
console.log("update")
let sessionid = localStorage.getItem("sessionid"); let sessionid = localStorage.getItem("sessionid");
let url = baseURL + "/users/all?sessionid=" + sessionid; let url = baseURL + "/users/all?sessionid=" + sessionid;
@@ -265,7 +264,6 @@ export default function InputForm(p) {
if (userModuleMapping.has(user.id)) { if (userModuleMapping.has(user.id)) {
let t = state.target.checked ? 1 : 0; let t = state.target.checked ? 1 : 0;
userModuleMapping.get(user.id).setActivated(t); userModuleMapping.get(user.id).setActivated(t);
console.log(userModuleMapping.get(user.id).getActivated())
} }
let temp = [] let temp = []
@@ -281,6 +279,7 @@ export default function InputForm(p) {
} }
return ( return (
<> <>
<Background/> <Background/>
@@ -308,16 +307,24 @@ export default function InputForm(p) {
width: 150 width: 150
}}>Theorie Ende</p> }}>Theorie Ende</p>
</div> </div>
<div className={"MeinTest"}>
<div className="semesterDateInputPair"> <div className="semesterDateInputPair">
<input type="date" id="start" className={"box-shadow selector"} value={startDate} <input type="date" id="start" className={"box-shadow selector"} value={startDate}
style={{padding: 5}} style={{
padding: 5,
backgroundColor: (startDate != "" && endDate != "" && 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={{padding: 5}} style={{
padding: 5,
backgroundColor: (startDate != "" && endDate != "" && startDate >= endDate) ? "#E44747" : "white"
}}
onChange={(e) => setEndDate(e.target.value)}/> onChange={(e) => setEndDate(e.target.value)}/>
</div> </div>
</div> </div>
</div>
<div className="round-border dozentSelector"> <div className="round-border dozentSelector">
<table> <table>
<tbody> <tbody>
@@ -396,9 +403,8 @@ 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={() => { <Button color="#77932b" width="100px" height="30px" text="Speichern" onClick={() => { startDate >= endDate ? () => {} : onCreateClicked()}
onCreateClicked() }/>
}}/>
</div> </div>
</div> </div>
</> </>
+5
View File
@@ -577,3 +577,8 @@ SemesterTile
.semester-tile .step-container { .semester-tile .step-container {
pointer-events: none; pointer-events: none;
} }
.Error
{
}
Binary file not shown.
File diff suppressed because it is too large Load Diff