Bug In Cjuidatepicker Options

In CjuiDatePicker, I cannot use the option = "beforeShowDay", because this option need function return.

$this->widget('zii.widgets.jui.CJuiDatePicker', array(



			'options'   => array(

				'changeYear' => true,

				'dateFormat' => 'mm/dd/yy',

				//'timeFormat' => '',//'hh:mm tt' default

				//'beforeShowDay'=>'function(selectedDate){var disabledDates = ["04/30/2014", "05/01/2014"];for (var i = 0; i < disabledDates.length; i++) {if (new Date(disabledDates[i]).toString() == selectedDate.toString()){return false;}}return true;}',





But in CJuiDatePicker, it always return option value in a string value, which cannot call the function properly.



to see more details about datepicker api.

My suggestion is try to put "beforeShow" and "beforeShowDay" in a separate way to deal with.

Below line should be fixed in CJuiDatePicker.php


Hey Johnny, try put "js:" before it


Thank you, I tested that, and it works. That’s awesome!