Datepicker control (Extending/modifying CHtml helper)

How to extend/add method to CHtml to get date picker control using jQuery's datepicker?

If better way is extending, them where to place file, how to import it and where to use this helper?

Where to put jQuery's UI library? Is it already present somewhere in Yii? Is core jQuery library already included?

Do not extend CHtml because it is a static class and not very convenient to add complex logic like date picker needs.

Instead, write a new widget. You may refer to CTreeView or other similar widgets and see how to do so.

jQuery core library is in Yii, but not jQuery UI. Again, refer to CTreeView and see how to include a js library.

You don't need to extend CHtml, you need to create a Widget, by extending CInputWidget.

Quote

jQuery core library is in Yii, but not jQuery UI. Again, refer to CTreeView and see how to include a js library.

I think it should be helpful to have the jQuery UI included in Yii, so we can avoid possible conflicts in the case several extensions use that library. If the developers know that jQuery is included in Yii, they would use this instead of including it on their extensions.

Where should I put my widgets? Extensions dir? or where?

MetaYii: We won't include jQuery UI in the core in 1.0. We still need more time to fully evaluate it.

Konstantin: you can place widgets anywhere, as long as you can refer to it when using it. My personal preference is to put it under protected/components. The directory protected/extensions is used to store extensions you download from third party.