Projects, Fun to Make, Fun to Use

So I needed an interactive callander to place on a website I was writing. I could'nt find one I liked so here is the one I wrote. Feel free to copy it and modify it as needed.

The calander will automatically highlight Today's date. If you click on another day, it will highlight that day and set php values to the date chosen which you can use in your code for schedualing, looking up tasks or whatever else you would need a selected date for.

You can also forward and reverse through the months. It has Leap years included but I did not include the leap year skip of 2100 as I will not be around then and therefore dont care. Besides, I doubt this code will still be relevand in 82 years. Have fun!


The Calander

< October 2018>
Sun
Mon
Tue
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

The Code

Download here.

#callender {
	width:100%;
	height:30%;
	//margin-left:5%;
	
	//border:1px solid black;
	}
#month	{
	width:100%;
	height:10%;
	background-color:grey;
	color:#eee;
	text-align:center;
	font-size:2vh;
	}
#day	{
	box-sizing: border-box;
	width:14.28%;
	height:26%;
	float:left;
	border:1px solid black;
	}
.label	{
	width:14.26%;
	text-align:center;
	color:#eee;
	float:left;
	}
a	{
	color:black;
	}


< October 2018>
Sun
Mon
Tue
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
EOD; $str = htmlspecialchars($str, ENT_HTML5, ENT_NOQUOTES); $str = str_replace("&hellip;", "…", $str); echo($str);?>