Test Calendar Control |
||
|
This is a sample for the calendar control. The article that also serves as documentation can be found here, together with the download links. |
||
| Here is the component - try it by clicking on the links on it or on the links below the control; the dates will change the currently selected day, and the links around the header will move to the previous / next month | ||
|
||
The test has a lot of Ajax stuff which is very simple in this case, but even so,
please do not spend too much time understanding it if all you need is to
show this calendar on a page; in that case, the code below is all you need, after
including calendar.php file:
// create the CalendarData value object and setup some data: $dt = new CalendarData(); // setup some information $dt->month = 3; $dt->year = 2009; // create the Calendar object and obtain the html associated with it $cal = new Calendar($dt); $html = $cal->getHtml(); // and then, somewhere in the page where you need it shown: echo $html; | ||
|
To clarify one thing: the component is rendered solely on the server side (using php). No full rendering on browser using Javascript. When you click on "next month" or "previous month", you need to go to the server in order to render the calendar for the new month. I know this gives a bad perception, however consider this:
| ||
| All the colors, the widths are set by CSS. No explicit format html is generated for this particular purpose except attaching some CSS classes. This gives you full flexibility. Please look at the css file to see how the formatting was done. | ||
| Calendar control © by Daniel G |