Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Server-side Scripting _ Merry Christmas

Posted by: CharlesEF Dec 9 2021, 06:38 PM

Hi All,

I made this post to share my PHP calendar code. I only ask that any testing you do, please post back to this thread. This is a bare bones calendar, it doesn't do much. This will change in a future version. The 2 places where I didn't use PHP was for the month and day of the week names. I did this so I could show English (en) and Spanish (es) calendars. When unzipped you should have a 'temp' folder. Place it in your web server and load '/temp/calendar.php'. As is the calendar will show up in English.

Javascript is required. There are some variables you can change in 'calendar.php':
$firstDOW is the day of the week the calendar starts. Can be 0-6 (Sun - Sat).
$calLang is the calendar language, 'en' for English or 'es' for Spanish.
$fillBlanks is for showing the previous/next month dates (true) or not (false).

You shouldn't be able to do anything if the Year is blank or 0. Please test this code on any browser and report back your results.

Oh, the calendar is responsive so change your window size to see what happens. All my browsers only go down to 500px.


Thank you,

Charles
Attached File  calendar.zip ( 133.53k ) Number of downloads: 289

Posted by: CharlesEF Jan 26 2022, 05:17 PM

Hi All,

I just want to post the final version of the calendar, after all the updates and tweaks. This zip also contains a Javascript version of the calendar. It will run with or without a web server. I post this hoping it may help anyone who needs to work with PHP or Javascript date objects. Or, how the Javascript version builds the calendar table.


Hope this helps,

Charles
Attached File  calendar.zip ( 145.29k ) Number of downloads: 259

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)