Calendar Sidebar Added
Calendar Sidebar edited and added to the CalendarView
This commit is contained in:
1 parent
62902d1b47
commit
76ff99a365
6 files changed
+1433669
-2809481
No files matched your search
@@ -7,24 +7,36 @@ let check = true
|
||||
const weekdays = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"]
|
||||
export default function BasicDateCalendar(p) {
|
||||
if (check) {
|
||||
generateCalendar("01.12.2024", "15.09.2025")
|
||||
let startDate = new Date(p.startyear, 0 ,p.startday)
|
||||
let endDate = new Date(p.endyear, 0 , p.endday)
|
||||
let startString = startDate.getDate() + "." + (startDate.getMonth() + 1) + "." + p.startyear
|
||||
let endString = endDate.getDate() + "." + (endDate.getMonth() + 1) + "." + p.endyear
|
||||
console.log(startString)
|
||||
console.log(endString)
|
||||
generateCalendar(startString, endString)
|
||||
check = false
|
||||
}
|
||||
return (
|
||||
<div className={"Down"}>
|
||||
{result.map((monthResult, index = 0) => (
|
||||
<div key={months} className={"A"}>
|
||||
<p>{getMonthName(index)}</p>
|
||||
<div className={"Days"}>
|
||||
{weekdays.map((weekday) => (
|
||||
<p key={weekday}>{weekday}</p>
|
||||
))}
|
||||
{monthResult.map((date) => (
|
||||
<p key={date}>{date}</p>
|
||||
))}
|
||||
<div className={"Allround"}>
|
||||
<div className={"Down"}>
|
||||
{result.map((monthResult, index = 0) => (
|
||||
<div key={months} className={"A box-shadow"} >
|
||||
<p style={{
|
||||
textAlign : "center",
|
||||
marginBottom : 10,
|
||||
fontSize: 19
|
||||
}}>{getMonthName(index)}</p>
|
||||
<div className={"Days"}>
|
||||
{weekdays.map((weekday) => (
|
||||
<p key={weekday}>{weekday}</p>
|
||||
))}
|
||||
{monthResult.map((date) => (
|
||||
<p key={date}>{date}</p>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -96,7 +108,6 @@ function generateCalendar(start, ende)
|
||||
function splitter(startDate, endDate)
|
||||
{
|
||||
startParts = startDate.split(".")
|
||||
//Transformer()
|
||||
if (startParts[1][0] === 0) //prüft ob die erste Stelle des Monats eine 0 vorne stehen hat
|
||||
{
|
||||
startParts[1] = startParts[1][1] //überschreibt den Monat ohne die 0
|
||||
@@ -106,12 +117,4 @@ function splitter(startDate, endDate)
|
||||
{
|
||||
endParts[1] = endParts[1][1] //überschreibt den Monat ohne die 0
|
||||
}
|
||||
}
|
||||
|
||||
function Transformer()
|
||||
{
|
||||
let formattedDateStr = startParts[1] + "/" + startParts[0] + "/" + startParts[2];
|
||||
console.log(formattedDateStr)
|
||||
let weekday = new Date(formattedDateStr).getDay();
|
||||
console.log(weekday);
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import CalenderView from "@/components/CalenderView";
|
||||
import Background from "@/components/Background";
|
||||
import Logout from "@/components/Logout";
|
||||
import Back from "@/components/Back";
|
||||
import BasicDateCalendar from "@/components/CalendarSideBar";
|
||||
import {useRouter} from "next/router";
|
||||
|
||||
|
||||
@@ -14,7 +15,18 @@ export default function planning(p)
|
||||
<Logout/>
|
||||
<Back onClick={() => router.back()}/>
|
||||
<Background/>
|
||||
<div style={{
|
||||
display : "flex",
|
||||
flexDirection : "row",
|
||||
justifyContent : "space-around",
|
||||
alignItems : "center"
|
||||
}}>
|
||||
<BasicDateCalendar startyear={2015} startday={1} endyear={2015} endday={80}/>
|
||||
<CalenderView/>
|
||||
<div style={{
|
||||
width : 250
|
||||
}}></div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
||||
sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.A
|
||||
{
|
||||
border: 2px solid;
|
||||
border-color: black;
|
||||
border: 0px solid;
|
||||
border-radius: 20px;
|
||||
margin: 2px;
|
||||
background: linear-gradient(to bottom, #FFC1C1, #CD3333);
|
||||
margin: 10px;
|
||||
background-color: white;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.A P
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.Days
|
||||
@@ -21,8 +17,8 @@ body {
|
||||
display: inline-grid;
|
||||
grid-template-columns: repeat(7, 1fr);
|
||||
grid-template-rows: repeat(5, 1fr);
|
||||
height: 50%;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
.Down
|
||||
@@ -32,4 +28,12 @@ body {
|
||||
grid-column: auto;
|
||||
height: 200%;
|
||||
width: 20%;
|
||||
}
|
||||
}
|
||||
|
||||
.Allround
|
||||
{
|
||||
position: relative;
|
||||
max-height : 72vh;
|
||||
overflow-y: scroll;
|
||||
overflow-anchor: none;
|
||||
}
|
||||
Reference in new issue
Block a user