本文整理汇总了PHP中dosamigos\datepicker\DatePicker类的典型用法代码示例。如果您正苦于以下问题:PHP DatePicker类的具体用法?PHP DatePicker怎么用?PHP DatePicker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DatePicker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
/**
* Поле выбора даты
* @return string
* @throws \Exception
*/
public function date()
{
if ($this->model->getIsNewRecord()) {
$this->model->{$this->attribute} = time();
}
$this->model->{$this->attribute} = date('d.m.Y', $this->model->{$this->attribute});
return $this->widget(DatePicker::className(), ['model' => $this->model, 'attribute' => $this->attribute, 'clientOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy']]);
}
示例2: renderFilterCellContent
protected function renderFilterCellContent()
{
return DatePicker::widget([
'model' => $this->grid->filterModel,
'attribute' => $this->dateColumn,
'template' => '{addon}{input}',
'clientOptions' => [
'autoclose' => true,
'format' => 'yyyy-mm-dd',
'disableEntry'=>true,
],
'options' => [
'data-pjax' => '0',
]
]);
}
示例3:
$this->title = 'Customer Records';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="customer-record-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
// echo $this->render('_search', ['model' => $searchModel]);
?>
<p>
<?php
if (Yii::$app->user->can('manager')) {
?>
<?php
echo Html::a('Create Customer Record', ['create'], ['class' => 'btn btn-success']);
?>
<?php
}
?>
</p>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', ['attribute' => 'birth_date', 'format' => ['date', 'dd-MMMM-Y'], 'options' => ['style' => 'width:240px'], 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'birth_date', 'template' => '{addon}{input}', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']])], ['attribute' => 'phones.number'], ['class' => 'yii\\grid\\ActionColumn', 'header' => 'Actions', 'template' => Yii::$app->user->can('manager') ? '{view} {update} {delete}' : '{view}']]]);
?>
</div>
示例4:
?>
<?php
echo $form->field($model, 'company_name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'company_email')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'company_address')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'company_start_date')->widget(DatePicker::className(), ['inline' => false, 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($model, 'file')->fileInput();
?>
<?php
echo $form->field($model, 'company_status')->dropDownList(['active' => 'Active', 'inactive' => 'Inactive'], ['prompt' => '- Status -']);
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
示例5:
?>
<?php
echo $form->field($model, 'numPeriodo')->textInput(['style' => 'width:130px']);
?>
<?php
echo $form->field($model, 'anoPeriodo')->textInput(['style' => 'width:130px']);
?>
<?php
echo $form->field($model, 'dataInicioPeriodo')->widget(DatePicker::className(), ['inline' => false, 'language' => 'pt', 'template' => '{addon}{input}', 'options' => ['style' => 'width:130px'], 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($model, 'dataFimPeriodo')->widget(DatePicker::className(), ['inline' => false, 'language' => 'pt', 'template' => '{addon}{input}', 'options' => ['style' => 'width:130px'], 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($model, 'usaLaboratorio')->checkbox();
?>
<?php
echo $form->field($model, 'qtdVagas')->textInput(['style' => 'width:130px']);
?>
<?php
echo $form->field($model, 'qtdMonitorBolsista')->textInput(['style' => 'width:130px']);
?>
<?php
示例6:
'labelField' => 'fullName',
'searchField' => ['fullName'],
],
]);*/
?>
<?php
echo $form->field($model, 'series')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'num')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'date')->widget(\dosamigos\datepicker\DatePicker::className(), ['language' => 'ru', 'options' => ['class' => 'form-control', 'autocomplete' => 'off'], 'clientOptions' => ['forceParse' => true, 'todayBtn' => true, 'clearBtn' => true, 'autoclose' => true, 'todayHighlight' => true, 'format' => 'dd.mm.yyyy']]);
?>
<?php
echo $form->field($model, 'duration_months')->textInput();
?>
<?php
echo $form->field($model, 'duration_days')->textInput();
?>
<?php
echo $form->field($model, 'who_give')->widget(\dosamigos\selectize\SelectizeDropDownList::className(), ['items' => \yii\helpers\ArrayHelper::map(\app\models\DocMigration::find()->select(['who_give'])->active()->distinct()->orderBy('who_give asc')->asArray()->all(), 'who_give', 'who_give'), 'options' => ['multiple' => false, 'class' => 'form-control', 'prompt' => ''], 'clientOptions' => ['selectOnTab' => true, 'openOnFocus' => false, 'persist' => false, 'maxItems' => 1, 'create' => true, 'valueField' => 'who_give', 'labelField' => 'who_give', 'searchField' => ['who_give']]]);
?>
<?php
示例7:
<?= $form->field($model, 'allowance_amount')->textInput() ?>
<?= $form->field($model, 'allowance_remark')->textInput(['maxlength' => true]) ?>
<?= $form->field($model,'allowance_school_id')->widget(Select2::classname(),
[
'data'=>ArrayHelper::map(Schools::find()->all(), 'School_id','school_name'),
'language'=>'en',
'options'=>['placeholder'=>'Select School Name'],
'pluginOptions'=>['allowClear'=>true],
]) ?>
<?= $form->field($model, 'allowance_payStatus')->dropDownList([ 'paid' => 'Paid', 'not paid' => 'Not paid', ], ['prompt' => 'Select Payment Status']) ?>
<?= $form->field($model, 'allowance_paidDate')->widget(
DatePicker::className(), [
// inline too, not bad
'inline' => false,
// modify template for custom rendering
// 'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>',
'clientOptions' => [
'autoclose' => true,
'format' => 'yyyy-mm-dd'
]
]);?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
示例8:
if ($profile->photo) {
?>
<?php
echo "<img width='100'src='http://wemamastest.ru.mastertest.ru/web/" . $profile->photo . "' />";
?>
<?php
}
?>
<?php
echo $form->field($profile, 'file')->fileInput();
?>
<?php
echo $form->field($profile, 'location');
?>
<?php
echo $form->field($profile, 'birthday')->widget(DatePicker::className(), ['inline' => false, 'clientOptions' => ['autoclose' => false, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($profile, 'subscribe')->widget(CheckboxX::classname());
?>
<div class="form-group">
<div class="col-lg-offset-3 col-lg-9">
<?php
echo Html::submitButton(Yii::t('user', 'Update'), ['class' => 'btn btn-block btn-success']);
?>
</div>
</div>
示例9:
?>
<?php
echo $form->errorSummary([$model, $fileModel]);
?>
<?php
echo $form->field($model, 'author_id')->dropDownList(ArrayHelper::map(Authors::getAllAuthors(), 'id', 'name'), ['prompt' => Yii::t('app', 'Выберите автора')]);
?>
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'date_fabr')->widget(DatePicker::className(), ['language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'dd/mm/yyyy'], 'options' => ['placeholder' => '12/31/2014']]);
?>
<?php
if ($model->preview) {
?>
<img src="<?php
echo Image::thumb($model->preview, 240);
?>
">
<a href="<?php
echo Url::to(['/books/admin/clear-image', 'id' => $model->primaryKey]);
?>
" class="text-danger confirm-delete" title="<?php
echo Yii::t('app', 'Clear image');
?>
示例10:
<?php
use yii\helpers\Html;
use dosamigos\datepicker\DatePicker;
/* @var $this yii\web\View */
/* @var $model app\models\Peso */
$this->title = 'Nuevo Peso';
$this->params['breadcrumbs'][] = ['label' => 'Pesos', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
echo DatePicker::widget(['model' => $model, 'attribute' => 'fecha', 'template' => '{addon}{input}', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<div class="peso-create">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
echo $this->render('_form', ['model' => $model]);
?>
</div>
示例11:
<?php
echo $form->field($model, 'department_name')->textInput(['maxlength' => true]);
?>
<!--<?php
echo $form->field($model, 'department_create_data')->textInput();
?>
-->
<?php
echo $form->field($model, 'department_create_data')->widget(DatePicker::className(), ['inline' => false, 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($model, 'department_status')->dropDownList(['active' => 'Active', 'inactive' => 'Inactive'], ['prompt' => '']);
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
示例12: function
}, 'attribute' => 'create_time'], ['class' => 'yii\\grid\\DataColumn', 'value' => function ($data) {
if ($data->pay_time) {
return date('Y-m-d H:i:s', $data->pay_time);
// 如果是数组数据则为 $data['name'] ,例如,使用 SqlDataProvider 的情形。
}
}, 'attribute' => 'pay_time', 'filter' => DatePicker::widget(['addon' => '', 'language' => 'zh-CN', 'name' => 'pay_time
', 'value' => Yii::$app->request->get('pay_time'), 'template' => '{addon}{input}', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']])], ['class' => 'yii\\grid\\DataColumn', 'value' => function ($data) {
if ($data->finish_time) {
return $data->finish_time;
// return Yii::$app->formatter->asDate($data->finish_time, 'yyyy-MM-dd'); // 如果是数组数据则为 $data['name'] ,例如,使用 SqlDataProvider 的情形。
} else {
return '交易进行中';
}
}, 'attribute' => 'finish_time'], 'address', ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'gostatus', 'label' => '订单状态', 'value' => function ($model) {
return \app\models\Gorder::get_gostatus1($model->gostatus);
}, 'filter' => \app\models\Gorder::get_gostatus()], ['class' => 'yii\\grid\\ActionColumn', 'controller' => 'my', 'template' => '{view}', 'header' => '查看订单详情'], ['class' => 'yii\\grid\\ActionColumn', 'header' => '操作']]]);
?>
<?php
echo DatePicker::widget(['name' => '', 'value' => '', 'template' => '{addon}{input}', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
</div>
<script>
// 用户可点击复选框来选择网格中的一些行。被选择的行可通过调用下面的JavaScript代码来获得:
var keys = $('#grid').yiiGridView('getSelectedRows'); //为什么提示 $不存在
// keys 为一个由与被选行相关联的键组成的数组
</script>
示例13:
echo $form->field($model, 'name')->label(false)->textInput(['maxwidth' => true, 'placeholder' => 'название книги']);
?>
</div>
</div>
<div class="row">
<div class="col-lg-3">
Дата выход книги:
<?php
echo DatePicker::widget(['name' => 'BookSearch[from_date]', 'value' => null !== Yii::$app->request->get('BookSearch')['from_date'] ? Yii::$app->request->get('BookSearch')['from_date'] : '', 'template' => '{addon}{input}', 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy', 'todayHighlight' => true]]);
?>
</div>
<div class="col-lg-3">
до
<?php
echo DatePicker::widget(['name' => 'BookSearch[to_date]', 'value' => null !== Yii::$app->request->get('BookSearch')['to_date'] ? Yii::$app->request->get('BookSearch')['to_date'] : '', 'template' => '{addon}{input}', 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy', 'todayHighlight' => true]]);
?>
</div>
<div class="col-lg-4">
<div> </div>
<div class="form-group">
<?php
echo Html::submitButton('Найти', ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Сброс', Url::to(['/book']), ['class' => 'btn btn-default']);
?>
</div>
</div>
</div>
示例14:
<?php
echo $form->field($model, 'author')->textInput(['maxlength' => true]);
?>
<?php
echo \common\widgets\Plupload::widget(['model' => $model, 'attribute' => 'cover_img', 'url' => '/file/upload', 'path' => Yii::$app->request->hostInfo]);
?>
<?php
echo $form->field($model, 'status')->radioList([Article::STATUS_DISPLAY => '可用', Article::STATUS_HIDDEN => '禁用']);
?>
<?php
echo Html::activeLabel($model, 'publish_at');
?>
<?php
echo DatePicker::widget(['model' => $model, 'attribute' => 'publish_at', 'template' => '{input} {addon}', 'language' => 'zh-CN', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd', 'weekStart' => '1']]);
?>
<?php
if (Yii::$app->controller->action->id == 'create') {
?>
<?php
echo $form->field($model, 'tag')->textInput()->hint('多个标签用;隔开');
?>
<?php
} else {
?>
<?php
echo Html::activeLabel($model, 'tag');
?>
<?php
echo Html::activeTextInput($model, 'tag', ['value' => $tag, 'disabled' => true]);
示例15:
<div >
<label class="col-lg-2 control-label">Nouveau Bureau:</label>
<?php
echo $form->field($bureau, 'codebureau', ['horizontalCssClasses' => ['wrapper' => 'col-sm-3']])->dropDownList(ArrayHelper::map(Bureau::find()->asArray()->all(), 'codebureau', 'codebureau'), ['prompt' => '----------Choisir le bureau----------'])->label(false);
?>
</div>
<div>
<label for="DateTrans" class="col-lg-2 control-label">Date de transfert:</label>
<?php
echo $form->field($trans, 'dt')->widget(DatePicker::className(), ['template' => '{addon}{input}', 'clientOptions' => ['autoclose' => true, 'format' => 'dd/mm/yyyy']])->label(false);
?>
</div>
<div >
<label for="motif" class="col-lg-2 control-label">Motif du transfert:</label>
<?php
echo $form->field($trans, 'motif')->textarea()->label(false);
?>
</div>