Starttime edited

Starttime can be changed now
This commit is contained in:
AliGitGut
2023-05-26 14:50:04 +02:00
parent edaba10719
commit 594c82ce23
4 changed files with 15062 additions and 16 deletions
+28 -15
View File
@@ -12,6 +12,7 @@ let semesterStart;
let currentWeekStartDay; let currentWeekStartDay;
let currentYear; let currentYear;
let selectedElement; let selectedElement;
let grabbedDown;
export default function CalenderView(p) { export default function CalenderView(p) {
@@ -94,7 +95,7 @@ export default function CalenderView(p) {
"yearnumber": 0, "yearnumber": 0,
"semesterid": 0, "semesterid": 0,
"usercreatedbyid": 0, "usercreatedbyid": 0,
"timestart": 0, "timestart": selectedElement.timestart,
"timeend": selectedElement.timeend, "timeend": selectedElement.timeend,
"info": "" "info": ""
} }
@@ -117,10 +118,13 @@ export default function CalenderView(p) {
let row = Math.floor((y_window - y_target_offset) / cellHeight) + 1; let row = Math.floor((y_window - y_target_offset) / cellHeight) + 1;
let currentColumnID = parseInt(e.currentTarget.id) let currentColumnID = parseInt(e.currentTarget.id)
if (selectedElement.timestart < row - 1) { if (grabbedDown)
{
selectedElement.timeend = row + 1; selectedElement.timeend = row + 1;
}else
{
selectedElement.timestart = row + 1;
} }
setUpdate(!update); setUpdate(!update);
} }
} }
@@ -139,6 +143,14 @@ export default function CalenderView(p) {
pushEntry(currentColumnID, row) pushEntry(currentColumnID, row)
} }
} else { } else {
grabbedDown = currentId.includes("down")
/*
if(currentId.includes("up"))
{
grabbedDown = false;
}else grabbedDown = true;
*/
let parentID = parseInt(e.target.parentElement.id.replace("e", "")); let parentID = parseInt(e.target.parentElement.id.replace("e", ""));
selectedElement = getElementInColumn(parentID, currentColumnID); selectedElement = getElementInColumn(parentID, currentColumnID);
} }
@@ -166,6 +178,7 @@ export default function CalenderView(p) {
currentWeekStartDay = 0; currentWeekStartDay = 0;
currentYear = 2000; currentYear = 2000;
selectedElement = null; selectedElement = null;
grabbedDown = false;
let url = "http://localhost:8080/semester/id?sessionid=" + localStorage.getItem("sessionid") + let url = "http://localhost:8080/semester/id?sessionid=" + localStorage.getItem("sessionid") +
"&id=" + localStorage.getItem("currentsid"); "&id=" + localStorage.getItem("currentsid");
@@ -250,12 +263,12 @@ export default function CalenderView(p) {
gridRowEnd: d.timeend, gridRowEnd: d.timeend,
backgroundColor: "#77932b" backgroundColor: "#77932b"
}} id={d.id + "e"}> }} id={d.id + "e"}>
<div></div> <div className={"resize-grab"} id={"grabup"}></div>
<div style={{maxHeight: "60%"}} className={"no-pointer-events"}> <div style={{maxHeight: "60%"}} className={"no-pointer-events"}>
<p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p> <p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p>
<p>Modul</p> <p>Modul</p>
</div> </div>
<div className={"resize-grab"} id={"grab"}></div> <div className={"resize-grab"} id={"grabdown"}></div>
</div>))} </div>))}
</div> </div>
@@ -273,12 +286,12 @@ export default function CalenderView(p) {
backgroundColor: "#77932b" backgroundColor: "#77932b"
}} id={d.id + "e"}> }} id={d.id + "e"}>
<div></div> <div className={"resize-grab"} id={"grabup"}></div>
<div style={{maxHeight: "60%"}} className={"no-pointer-events"}> <div style={{maxHeight: "60%"}} className={"no-pointer-events"}>
<p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p> <p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p>
<p>Modul</p> <p>Modul</p>
</div> </div>
<div className={"resize-grab"} id={"grab"}></div> <div className={"resize-grab"} id={"grabdown"}></div>
</div>))} </div>))}
</div> </div>
@@ -297,12 +310,12 @@ export default function CalenderView(p) {
backgroundColor: "#77932b" backgroundColor: "#77932b"
}} id={d.id + "e"}> }} id={d.id + "e"}>
<div></div> <div className={"resize-grab"} id={"grabup"}></div>
<div style={{maxHeight: "60%"}} className={"no-pointer-events"}> <div style={{maxHeight: "60%"}} className={"no-pointer-events"}>
<p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p> <p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p>
<p>Modul</p> <p>Modul</p>
</div> </div>
<div className={"resize-grab"} id={"grab"}></div> <div className={"resize-grab"} id={"grabdown"}></div>
</div>))} </div>))}
</div> </div>
@@ -320,12 +333,12 @@ export default function CalenderView(p) {
backgroundColor: "#77932b" backgroundColor: "#77932b"
}} id={d.id + "e"}> }} id={d.id + "e"}>
<div></div> <div className={"resize-grab"} id={"grabup"}></div>
<div style={{maxHeight: "60%"}} className={"no-pointer-events"}> <div style={{maxHeight: "60%"}} className={"no-pointer-events"}>
<p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p> <p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p>
<p>Moduel etc.</p> <p>Moduel etc.</p>
</div> </div>
<div className={"resize-grab"} id={"grab"}></div> <div className={"resize-grab"} id={"grabdown"}></div>
</div>))} </div>))}
</div> </div>
@@ -343,12 +356,12 @@ export default function CalenderView(p) {
gridRowEnd: d.timeend, gridRowEnd: d.timeend,
backgroundColor: "#77932b" backgroundColor: "#77932b"
}} id={d.id + "e"}> }} id={d.id + "e"}>
<div></div> <div className={"resize-grab"} id={"grabup"}></div>
<div style={{maxHeight: "60%"}} className={"no-pointer-events"}> <div style={{maxHeight: "60%"}} className={"no-pointer-events"}>
<p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p> <p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p>
<p>Modul</p> <p>Modul</p>
</div> </div>
<div className={"resize-grab"} id={"grab"}></div> <div className={"resize-grab"} id={"grabdown"}></div>
</div>))} </div>))}
</div> </div>
@@ -366,12 +379,12 @@ export default function CalenderView(p) {
gridRowEnd: d.timeend, gridRowEnd: d.timeend,
backgroundColor: "#77932b" backgroundColor: "#77932b"
}} id={d.id + "e"}> }} id={d.id + "e"}>
<div></div> <div className={"resize-grab"} id={"grabup"}></div>
<div style={{maxHeight: "60%"}} className={"no-pointer-events"}> <div style={{maxHeight: "60%"}} className={"no-pointer-events"}>
<p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p> <p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p>
<p>Modul</p> <p>Modul</p>
</div> </div>
<div className={"resize-grab"} id={"grab"}></div> <div className={"resize-grab"} id={"grabdown"}></div>
</div>))} </div>))}
</div> </div>
</div> </div>
Binary file not shown.
File diff suppressed because it is too large Load Diff
@@ -118,7 +118,7 @@ public class DataBaseHandler
{ {
try try
{ {
st.executeUpdate("update entries set timeend=" + entry.getTimeend() + " where id=" + entry.getId()); st.executeUpdate("update entries set timeend=" + entry.getTimeend() + ", timestart=" + entry.getTimestart() + " where id=" + entry.getId());
} }
catch(Exception e) catch(Exception e)
{ {