So I have this widget on my Yii _form.php
page.
Is it possible to do things like blocking a certain day of the month? Or maybe blocking all the Mondays of the Month, disallowing users to select any Monday.
UPDATES based on hamed's answer
<script type="text/javascript">
function disableSpecificDays(date) {
//date is an instance of Date
var weekDay = date.getDay(); // Get the weekday as a number (0-6)
if(weekDay == 1){ //weekDay == 1 means Monday
return false;
}
else {
return true;
}
}
</script>
And on the view side,
<?php $form->widget('zii.widgets.jui.CJuiDatePicker', array(
'model' => $model,
'attribute' => 'date',
'value' => $model->date,
'options' => array(
'showAnim'=>'fadeIn',
'showButtonPanel' => true,
'minDate'=>'0',
'changeYear' => true,
'dateFormat' => 'yy-mm-dd',
'beforeShowDay' => 'disableSpecificDays',
),
));
?>
But for some reason, it blocks EVERYTHING on the date picker. Nothing can be chosen at all. At which point did I do wrong? Please advise.