Calender View Sync Prototype Working Correctly

This commit is contained in:
brausjonas
2023-05-26 02:10:15 +02:00
parent f52d4275ba
commit b4c71af857
9 changed files with 3068 additions and 532 deletions
+5 -9
View File
@@ -4,17 +4,13 @@ function addDays(date, days) {
return result;
}
export default function DateElement(props){
let startDate;
let endDate;
const currDate = new Date();
export default function DateElement(p){
startDate = addDays(currDate, (currDate.getDay()-1)*-1); //berechnet den Montag der aktuellen Woche
startDate = addDays(startDate, props.week*7); //erhöht das Datum um 7 Tage für jede Woche, die weiter geklickt wurde.
endDate = addDays(startDate, 6);
let startDate = new Date(p.year, 0, p.startday);
let endDate = new Date(p.year, 0, p.startday + 5);
const startDateString = `${startDate.getDate()}.${startDate.getMonth()+1}.${startDate.getFullYear()}`;
const endDateString = `${endDate.getDate()}.${endDate.getMonth()+1}.${endDate.getFullYear()}`;
let startDateString = `${startDate.getDate()}.${startDate.getMonth()+1}.${startDate.getFullYear()}`;
let endDateString = `${endDate.getDate()}.${endDate.getMonth()+1}.${endDate.getFullYear()}`;
return (
<>
<div className="dateElement round-border">