jmr22
(jmr22)
March 25, 2019, 7:23pm
1
Hola les hago una consulta como puedo desabilitar los dias que hay en un array mas los fines de semana si me dan una mano se los agradesco. saludos dejo el codigo
$feriados="['17/03/2019', '18/03/2019', '25/03/2019', '04/03/2019']";
echo DatePicker::widget([
'name' => 'Fecha',
'id' => 'Fecha',
'language' => 'es',
'dateFormat' => 'dd-MM-yyyy',
'clientOptions' => [
'changeMonth' => true,
'changeYear' => true,
'showButtonPanel' => true,
'yearRange' => '2019:2019' ,
],
'options'=> ['class'=>'', 'autocomplete'=>'off',]
]); ?>
softark
(Softark)
March 25, 2019, 10:01pm
2
Hi @jmr22 , welcome to the forum.
I have moved this post from “Yii 2.0” to “International > Spanish”.
Please write in English in general forums.
machour
(Mehdi Achour)
March 26, 2019, 9:18am
4
Hola @jmr22 ,
You probably will want to add beforeShowDay
, see JS example here:
https://www.codeproject.com/Questions/876970/how-to-disable-specific-days-in-JQuery-datepicker
echo DatePicker::widget([
'name' => 'Fecha',
'id' => 'Fecha',
'language' => 'es',
'dateFormat' => 'dd-MM-yyyy',
'clientOptions' => [
'changeMonth' => true,
'changeYear' => true,
'showButtonPanel' => true,
'yearRange' => '2019:2019' ,
'beforeShowDay' => yii\web\JsExpression(<<<JS
function(d) {
console.log("showing: ", d);
// do your test & return true if this day should be enabled, false otherwise
}
JS
)
],
'options'=> ['class'=>'', 'autocomplete'=>'off',]
]); ?>
1 Like
jmr22
(jmr22)
March 26, 2019, 11:20am
5
hola @machour genial muchas gracias
1 Like