当前位置: 首页>>代码示例>>PHP>>正文


PHP datepicker\DatePicker类代码示例

本文整理汇总了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']]);
 }
开发者ID:h11Nox,项目名称:slug,代码行数:13,代码来源:ActiveField.php

示例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',
         ]
     ]);
 }
开发者ID:harish-reglobbe,项目名称:Auction,代码行数:16,代码来源:DatePickerColumn.php

示例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>
开发者ID:andhikayuana,项目名称:latyii2,代码行数:30,代码来源:index.php

示例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>
开发者ID:hovantiep,项目名称:advanced,代码行数:31,代码来源:_form.php

示例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 
开发者ID:tammy00,项目名称:paps,代码行数:31,代码来源:_form.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 
开发者ID:slavam,项目名称:placement,代码行数:31,代码来源:_fields.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(); ?>
开发者ID:seans888,项目名称:SMF-Project,代码行数:31,代码来源:_form.php

示例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>
开发者ID:Kolya-an,项目名称:wemamas,代码行数:31,代码来源:_profile.php

示例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');
    ?>
开发者ID:kolibri1,项目名称:test,代码行数:31,代码来源:_form.php

示例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>

开发者ID:pelos6,项目名称:miAppYII,代码行数:23,代码来源:create+-+copia+(3).php

示例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();
?>
开发者ID:oneword,项目名称:yii2DoingITeasyChannelCode,代码行数:29,代码来源:_form.php

示例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>
开发者ID:lipengyihao,项目名称:yii2-basic-advanced,代码行数:30,代码来源:index.php

示例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>&nbsp;</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>
开发者ID:maxodrom,项目名称:testbook,代码行数:30,代码来源:_search.php

示例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]);
开发者ID:specialnote,项目名称:myYii,代码行数:31,代码来源:_form.php

示例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>
             
开发者ID:ikramadjissa,项目名称:Yii2Immo,代码行数:27,代码来源:_formTransfert.php


注:本文中的dosamigos\datepicker\DatePicker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。