Calender Side Bar on Click

This commit is contained in:
brausjonas
2023-06-08 22:50:33 +02:00
parent 2abef513fe
commit 8eed2746e9
5 changed files with 29609 additions and 345 deletions
+20 -7
View File
@@ -17,23 +17,34 @@ export default function BasicDateCalendar(p) {
generateCalendar(startString, endString)
check = false
}
return (
<div className={"Allround"}>
<div className={"Down"}>
{result.map((monthResult, index = 0) => (
<div key={months} className={"A box-shadow"} >
{result.map((monthResult, index) => (
<div className={"A box-shadow"} onClick={() => p.onMonthClick(
(parseInt(startParts[1]) + index),
startParts
)} >
<p style={{
textAlign : "center",
marginBottom : 10,
fontSize: 19
fontSize: 19,
pointerEvents: "none"
}}>{getMonthName(index)}</p>
<div className={"Days"}>
<div className={"Days"} style={{
pointerEvents: "none"
}}>
{weekdays.map((weekday) => (
<p key={weekday}>{weekday}</p>
<p key={weekday} style={{
pointerEvents: "none"
}}>{weekday}</p>
))}
{freeSpaces(index)}
{monthResult.map((date) => (
<p key={date}>{date}</p>
<p key={date} style={{
pointerEvents: "none"
}}>{date}</p>
))}
</div>
</div>
@@ -122,7 +133,9 @@ function freeSpaces(index)
{
let arrayTest = []
for (let i = 0; i < calculatedDay[index]; i++) {
arrayTest.push(<p></p>)
arrayTest.push(<p style={{
pointerEvents: "none"
}}></p>)
}
return arrayTest
}