diff --git a/anwendung/src/components/CalendarSideBar.jsx b/anwendung/src/components/CalendarSideBar.jsx index db2ad48..6eac2a3 100644 --- a/anwendung/src/components/CalendarSideBar.jsx +++ b/anwendung/src/components/CalendarSideBar.jsx @@ -11,6 +11,17 @@ const weekdays = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"] export default function BasicDateCalendar(p) { + function getBackMonthColor(monthIndex) + { + let date = new Date(parseInt(startParts[2]), parseInt(startParts[1]) + monthIndex, 1) + console.log(p.highlightYear + " " + date.getFullYear()) + if (date.getFullYear() === p.highlightYear && date.getMonth() === p.highlightMonth + 1) + { + return true + }else + return false + } + useEffect(() => { startParts = [] endParts = [] @@ -36,7 +47,10 @@ export default function BasicDateCalendar(p) { textAlign : "center", marginBottom : 10, fontSize: 19, - pointerEvents: "none" + pointerEvents: "none", + backgroundColor: getBackMonthColor(index) ? "#346991":"rgba(0,0,0,0)", + color : getBackMonthColor(index) ? "white":"black", + borderRadius : 10 }}>{getMonthName(index)}