Calendar
We define a class called 'Calendar' which renders a nice-looking graphical calendar 'widget' in the page and allows the user to click on dates and submit them to choose a date and 'do' something which is application-specific. The class contains various properties and methods to allow the user to find the current date that the calendar is set to, and acquire this date as a timestamp, nicely-formatted string or a DB-compliant value.
Located in /calendar-defs.php (line 40)
RenderableObject | --Calendar
Constructor. Create a new Calendar object with optional centre date (defaults to 'today'). This date is the one we return to when the 'today' button is clicked on the calendar & is the starting point.
Return the currently stored calendar date as a string which will be formatted so as to go into a database field nicely. This normally means ISO format (YYYY-MM-DD).
Return the currently stored calendar date as a string in a given date format (see Axyl datetime-defs.php for pre-defined formats).
The format is comprised of format characters as per the standard Php function 'date()' (see Php manual entry).
Return the current calendar date as a timestamp. This will return the timestamp at 00:00:00 (hh:mm:ss) ie. at the beginning of that day.
Return the calendar HTML
Check that currently stored Month, Day and Year make a correct date. Returns true if so.
Process GET/POST from form.
The form works in a GET mode, therefore new date settings are as if passed in on the URL. This method processes these, and sets the internal calendar date values accordingly.
Set the URL of script to POST the calendar form to.
Set the calendar to be rendered in a sub-form. This is just the same as rendering in a form, except we miss off the form tags.
Render calendar dates (the individual days) as clickable. This will cause a form submit, with the details of the date clicked on and the calendar will be set to that date.
Set the calendar to be rendered in its own form. If your calendar sits in an existing form, then call this method with 'false' to prevent it rendering its own form.
Set the 'today' date for the calendar. This is the date that is reset to when the user clicks on the 'TODAY' button. Of course it defaults to the current date when the calendar object is created, but this method allows for customised 'today' settings.
NB: If you call this with no paramters, it sets it to 'today'
Set the starting and finishing year for the calendar - the range of operation. This defaults to +/-10 years around the current year.
Inherited From RenderableObject
RenderableObject::RenderableObject()
RenderableObject::html()
RenderableObject::render()
RenderableObject::wml()
RenderableObject::wmlup()
RenderableObject::xml()
Documentation generated by phpDocumentor 1.3.0RC3