Hi guys!
I am using CJuiDatePicker to select a date, but i would like to be able to set up which day of the week you can choose. I mean, you see all the calendar but you could choose just Mondays (or any other desired day).
Is there any option to configure this extension to do that? If not, how could i do it?
I really appreciate any suggestion
Thanks!
SOLUTION:
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'name'=>'justmonday',
'options'=>array(
'showAnim'=>'fold',
'showOn'=>'both',
'beforeShowDay'=> 'js:function(date){
var day = date.getDay();
return [day == 1,""];
}',
),
'htmlOptions'=>array(
'style'=>'width:80px;vertical-align:top'
),
));
If you want to show more than 1 day, just add || day="NUMBER"
This will show Mondays and Fridays:
return [day == 1 || day == 5,""];