0
votes

I am new in yii2 framework. When I am trying to install widget, getting error message. My command is here:

sudo composer require 2amigos/yii2-date-picker-widget:~1.0

And error is here:

Your requirements could not be resolved to an installable set of packages.

Problem 1

- The requested package bower-asset/bootstrap-datepicker could not be found in any version, there may be a typo in the package name.

Problem 2

- 2amigos/yii2-date-picker-widget 1.0.x-dev requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- 2amigos/yii2-date-picker-widget 1.0.5 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- 2amigos/yii2-date-picker-widget 1.0.4 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- 2amigos/yii2-date-picker-widget 1.0.3 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- 2amigos/yii2-date-picker-widget 1.0.2 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- 2amigos/yii2-date-picker-widget 1.0.1 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- 2amigos/yii2-date-picker-widget 1.0.0 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- Installation request for 2amigos/yii2-date-picker-widget ~1.0 -> satisfiable by 2amigos/yii2-date-picker-widget[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.x-dev].

Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see https://getcomposer.org/doc/04-schema.md#minimum-stability for more details.

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

Does anybody can help me? Appreciate every answer!

2

2 Answers

3
votes

Have you tried to launch:

composer global require "fxp/composer-asset-plugin:~1.1.1"
0
votes

STEP -1 Run this command on Terminal at Project main folder ---->curl -s http://getcomposer.org/installer | php

STEP -2 Successfully installation after run this command --->php composer.phar require kartik-v/yii2-widget-datepicker "*"

you can see this contant in advanced->composer.json
 "kartik-v/yii2-widget-datepicker": "*"
If you can't see this, means you missing some...

STEP -3 Define this library in views-> _form.php use kartik\date\DatePicker;

STEP -4 And last define this given below code in your form at date field

<?= $form->field($model, 'xyz_field')->widget(DatePicker::ClassName(),
    [
    'name' => 'check_issue_date', 
   // 'value' => date('d-M-Y', strtotime('+2 days')),
    'options' => ['placeholder' => 'Select issue date ...'],
    'pluginOptions' => [
        'format' => 'yyyy/dd/mm',
        'todayHighlight' => true
    ]
]);?>