diff options
| author | Lester Caine <lester@lsces.co.uk> | 2005-12-18 08:50:01 +0000 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2005-12-18 08:50:01 +0000 |
| commit | 2a62042d1d01a78f5a4573c1586697d7d91d0f0f (patch) | |
| tree | 57eeb91f96131d7a22dcf04f8d02931d00ec5aaa | |
| parent | 5d2d8f414a1bf3c3be02fc70cd1af6d9d2fdc3f8 (diff) | |
| download | calendar-2a62042d1d01a78f5a4573c1586697d7d91d0f0f.tar.gz calendar-2a62042d1d01a78f5a4573c1586697d7d91d0f0f.tar.bz2 calendar-2a62042d1d01a78f5a4573c1586697d7d91d0f0f.zip | |
Remove server local time offset from current time - work UTC for dates.
| -rw-r--r-- | modules/mod_calendar.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/modules/mod_calendar.php b/modules/mod_calendar.php index cc7840c..27f0a1c 100644 --- a/modules/mod_calendar.php +++ b/modules/mod_calendar.php @@ -1,15 +1,28 @@ <?php +/** + * @version $Header: /cvsroot/bitweaver/_bit_calendar/modules/mod_calendar.php,v 1.6 2005/12/18 08:50:01 lsces Exp $ + * @package calendar + * @subpackage modules + */ + +/** + * Required setup + */ include_once( CALENDAR_PKG_PATH.'Calendar.php' ); $cal = new Calendar(); // set up the todate -if( !empty( $_REQUEST["todate"] ) ) { +if( !empty( $_REQUEST['todate'] ) ) { // clean up todate. who knows where this has come from - $_SESSION['calendar']['focus_date'] = $_REQUEST['todate'] = adodb_mktime( 0, 0, 0, adodb_date( 'm', $_REQUEST['todate'] ), adodb_date( 'd', $_REQUEST['todate'] ), adodb_date( 'Y', $_REQUEST['todate'] ) ); + if ( is_numeric( $_REQUEST['todate'] ) ) { + $_SESSION['calendar']['focus_date'] = $_REQUEST['todate'] = $cal->mDate->gmmktime( 0, 0, 0, $cal->mDate->date( 'm', $_REQUEST['todate'] ), $cal->mDate->date( 'd', $_REQUEST['todate'] ), $cal->mDate->date( 'Y', $_REQUEST['todate'] ) ); + } else { + $_SESSION['calendar']['focus_date'] = $_REQUEST['todate'] = $cal->mDate->gmmktime( 0, 0, 0, $cal->mDate->date2( 'm', $_REQUEST['todate'] ), $cal->mDate->date2( 'd', $_REQUEST['todate'] ), $cal->mDate->date2( 'Y', $_REQUEST['todate'] ) ); + } } elseif( !empty( $_SESSION['calendar']['focus_date'] ) ) { $_REQUEST["todate"] = $_SESSION['calendar']['focus_date']; } else { - $_SESSION['calendar']['focus_date'] = adodb_mktime( 0, 0, 0, adodb_date( 'm' ), adodb_date( 'd' ), adodb_date( 'Y' ) ); + $_SESSION['calendar']['focus_date'] = $cal->mDate->gmmktime( 0, 0, 0, $cal->mDate->date( 'm' ), $cal->mDate->date( 'd' ), $cal->mDate->date( 'Y' ) ); $_REQUEST["todate"] = $_SESSION['calendar']['focus_date']; } |
