Highlight Added
Bugs
This commit is contained in:
@@ -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)}</p>
|
||||
<div className={"Days"} style={{
|
||||
pointerEvents: "none"
|
||||
@@ -60,6 +74,8 @@ export default function BasicDateCalendar(p) {
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getMonthName(monthIndex) {
|
||||
if (startParts[1] - 1 + monthIndex < 12) {
|
||||
return months[startParts[1] - 1 + monthIndex][0];
|
||||
|
||||
Reference in New Issue
Block a user