This is a raw and simple example with only two clicks on the calendars (beginning and end)
You will get
$beg : start date.
$end : end date
$c1 unix time in second (start)
$c2 unix time in second (end)
So it's very simple to use those variables to select a range of records between a starting date and an ending date from a database.
This code has to be adapted for US date (if you are from the USA) and use some style sheet to improve the look 'n feel.
I'm planning to rewrite the code so that a single calendar will be used.
The use of this example is to quickly choose a range of dates to browse between events. For example, someone may what to get documents edited between a date and another in archives or someone may what to browse rapidly to choose a range to reserve a travel ticket.
Usage Example (test.php):
<?
if( ! defined ("BZ_calendar") ) include "lib/BZ_calendar.inc";
if ( $time=='' ) $time = time();
if ( !isset ($c1 )) $c1 = $time ;
if ( !isset ($c2 )) $c2 = $time ;
if (!isset ( $beg ) ) $beg = date("Y-m-d", $time);
if (!isset ( $end ) ) $end = date("Y-m-d", $time);
if ( $cal == 1 && $c2 < $c1 ) $c2 = $c1 ;
if ( $cal == 2 && $c2 < $c1 ) $c1 = $c2 ;
$cal1= new BZ_calendar( 1 , $beg , $end ) ;
$cal2 = new BZ_calendar( 2 , $beg , $end ) ;