From b621c0c9358a77a6ca8d53380a05ce1a957b54e5 Mon Sep 17 00:00:00 2001 From: Patrick Seeger Date: Fri, 21 Jun 2013 15:46:46 +0200 Subject: =?UTF-8?q?Nur=20g=C3=BCltige=20Termine=20werden=20angezeigt.=20So?= =?UTF-8?q?rtierung=20nach=20Zeit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protected/models/Verein.php | 2 +- protected/views/verein/view.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/protected/models/Verein.php b/protected/models/Verein.php index 242bd95..c5b6b4b 100644 --- a/protected/models/Verein.php +++ b/protected/models/Verein.php @@ -137,7 +137,7 @@ class Verein extends CActiveRecord { return array( 'published'=>array( - 'condition'=>'published=1', + 'condition'=>'published = 1', ), ); } diff --git a/protected/views/verein/view.php b/protected/views/verein/view.php index fe3ebd7..aa41066 100644 --- a/protected/views/verein/view.php +++ b/protected/views/verein/view.php @@ -47,9 +47,14 @@ $this->widget('zii.widgets.CListView', array( ));?>

Veranstaltungen

params["start_date"]." ".Yii::app()->params["start_time"], "dd.MM.yyyy HH:mm"); +$astafStart = Yii::app()->dateFormatter->format("yyyy-MM-dd HH:mm", $start); +$ende = CDateTimeParser::parse(Yii::app()->params["end_date"]." ".Yii::app()->params["end_time"], "dd.MM.yyyy HH:mm"); +$astafEnde = Yii::app()->dateFormatter->format("yyyy-MM-dd HH:mm", $ende); $dataProvider=new CActiveDataProvider('Veranstaltung', array( 'criteria'=>array( - 'condition'=>'verein_id='.$model->id." and published=1", + 'condition'=>'verein_id='.$model->id." and published=1 and startzeit between '$astafStart' and '$astafEnde' ", + 'order' => 'startzeit asc', ), 'pagination'=>array( 'pageSize'=>20, -- cgit v1.0-28-g1787