私はkrajee DatePickerを使用しています。kerjeeブートストラップdaterangepickerを読み込み専用にするにはどうすればいいですか?
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\web\View;
use yii\data\ActiveDataProvider;
use kartik\widgets\DatePicker;
use yii\web\JsExpression;
echo DatePicker::widget([
'name' => 'dp',
'id' => 'dp',
'type' => DatePicker::TYPE_INLINE,
'value' => '',
'pluginOptions' => [
'startDate' => $model->fecha_inicio,
'format' => 'yyyy-mm-dd',
'beforeShowDay' => new \yii\web\JsExpression("function(date) {
startDate = new Date('".$model->fecha_inicio."');
endDate = new Date('".$model->fecha_fin."');
between=startDate<=date && endDate>=date;
console.log(date+' '+ (between));
dateFormat = date.getUTCFullYear() + '-' + ('0'+(date.getUTCMonth()+1)).slice(-2) + '-' + ('0'+date.getUTCDate()).slice(-2);
if (dateFormat == '".$model->fecha_inicio."') {
return {classes: 'start-date', tooltip: 'Title'};
}
if (dateFormat == '".$model->fecha_fin."') {
return {classes: 'end-date', tooltip: 'Title'};
}
if (between) {
return {classes: 'in-range available'}; //create a custom class in css with back color you want
}
return false;
}"),
],
'options' => [
// you can hide the input by setting the following
'class' => 'hide'
]
]);
ユーザー入力を受け取ることなくDateRangePickerをレンダリングする方法はありますか? (例えば、ホバーなし、日付選択なし)。範囲をユーザーに知らせるためにウェブページ上にレンダリングしたいが、ユーザーがこのシナリオでやりとりするのは難しいと感じる。
あなたは 'DateRangePicker'へのリンクを与えますが、あなたのコードでは' DatePicker'を使用しています。あなたはどんなクラスを使っているのですか?たぶん、あなたの 'use'セクションを表示してください –
私のdaterangepickerを使ってみましたが、datepickerを使って考えました....私の質問はすぐに編集されます – Snivs