-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
53 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2016 | ||
* @package yii2-widgets | ||
* @subpackage yii2-widget-timepicker | ||
* @version 1.0.0 | ||
* @version 1.0.1 | ||
*/ | ||
|
||
namespace kartik\time; | ||
|
||
use yii\helpers\ArrayHelper; | ||
use yii\helpers\Html; | ||
use kartik\base\InputWidget; | ||
|
||
/** | ||
* The TimePicker widget allows you to easily select a time for a text input using | ||
* your mouse or keyboards arrow keys. Thus widget is a wrapper enhancement over the | ||
* TimePicker JQuery plugin by rendom forked from the plugin by jdewit. Additional | ||
* enhancements have been done to this input widget for compatibility with Bootstrap 3. | ||
* The TimePicker widget allows you to easily select a time for a text input using your mouse or keyboards arrow keys. | ||
* Thus widget is a wrapper enhancement over the TimePicker JQuery plugin by rendom forked from the plugin by jdewit. | ||
* Additional enhancements have been done to this input widget for compatibility with Bootstrap 3. | ||
* | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @since 1.0 | ||
* @see https://github.com/rendom/bootstrap-3-timepicker | ||
* @see https://github.com/jdewit/bootstrap-timepicker | ||
*/ | ||
class TimePicker extends \kartik\base\InputWidget | ||
class TimePicker extends InputWidget | ||
{ | ||
/** | ||
* @var string the size of the input - 'lg', 'md', 'sm', 'xs' | ||
|
@@ -36,12 +36,10 @@ class TimePicker extends \kartik\base\InputWidget | |
public $addon = '<i class="glyphicon glyphicon-time"></i>'; | ||
|
||
/** | ||
* @var array HTML attributes for the addon container | ||
* the following special options are identified | ||
* @var array HTML attributes for the addon container the following special options are identified | ||
* - asButton: boolean if the addon is to be displayed as a button. | ||
* - buttonOptions: array HTML attributes if the addon is to be | ||
* displayed like a button. If [[asButton]] is true, this will | ||
* default to ['class' => 'btn btn-default'] | ||
* - buttonOptions: array HTML attributes if the addon is to be displayed like a button. If [[asButton]] is true, | ||
* this will default to ['class' => 'btn btn-default'] | ||
*/ | ||
public $addonOptions = []; | ||
|
||
|
@@ -51,13 +49,15 @@ class TimePicker extends \kartik\base\InputWidget | |
public $containerOptions = []; | ||
|
||
/** | ||
* Initializes the widget | ||
* | ||
* @throw InvalidConfigException | ||
* @inheritdoc | ||
*/ | ||
public $pluginName = 'timepicker'; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function init() | ||
public function run() | ||
{ | ||
parent::init(); | ||
$this->registerAssets(); | ||
echo Html::tag('div', $this->renderInput(), $this->containerOptions); | ||
} | ||
|
@@ -111,6 +111,6 @@ public function registerAssets() | |
{ | ||
$view = $this->getView(); | ||
TimePickerAsset::register($view); | ||
$this->registerPlugin('timepicker'); | ||
$this->registerPlugin($this->pluginName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2016 | ||
* @package yii2-widgets | ||
* @subpackage yii2-widget-timepicker | ||
* @version 1.0.0 | ||
* @version 1.0.1 | ||
*/ | ||
|
||
namespace kartik\time; | ||
|
||
use kartik\base\AssetBundle; | ||
|
||
/** | ||
* Asset bundle for DateTimePicker Widget | ||
* | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @since 1.0 | ||
*/ | ||
class TimePickerAsset extends \kartik\base\AssetBundle | ||
class TimePickerAsset extends AssetBundle | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function init() | ||
{ | ||
$this->setSourcePath(__DIR__ . '/assets'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters