Activedatelist Extension

I tried this extension and got same error as people that commented on page

http://www.yiiframework.com/extension/activedatelist/#c323

When i added this code in my model errors stopped…





class SomeActiveRecord extends CActiveRecord

{

...

/**

	 * Extends setAttributes to handle active date fields

	 *

	 * @param $values

	 */	

	public function setAttributes ($values, $safe = true)

	{

		foreach ($this->dateAttributes() as $dateAttribute)

		{

			if (is_array($values[$dateAttribute]))

			{

				$day = $values[$dateAttribute]['d'];

				$month = $values[$dateAttribute]['m'];

				$year = $values[$dateAttribute]['Y'];

	

				$values[$dateAttribute] = date('Y-m-d',mktime(0,0,0,$month,$day,$year));				

			}

		}

		parent::setAttributes($values);		

	}

	

	public function dateAttributes()

	{

		return array('nameOfAttribute');

	}

...

}



About min date you can set it is 1910… If you set 1901 it will start from 1970… that is truth.

I hope this will help…