Skip to content

Commit

Permalink
Updates to release v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Jan 8, 2017
1 parent 886656d commit 203aeb9
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log: `yii2-widget-timepicker`
====================================

## Version 1.0.3

**Date:** 08-Jan-2017

- (enh #12): Correct timepicker change initialization.

## Version 1.0.2

**Date:** 04-Jan-2017
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ to the ```require``` section of your `composer.json` file.

## Latest Release

> NOTE: The latest version of the module is v1.0.2. Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-timepicker/blob/master/CHANGE.md) for details.
> NOTE: The latest version of the module is v1.0.3. Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-timepicker/blob/master/CHANGE.md) for details.
## Demo

Expand Down
17 changes: 9 additions & 8 deletions TimePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2017
* @package yii2-widgets
* @subpackage yii2-widget-timepicker
* @version 1.0.2
* @version 1.0.3
*/

namespace kartik\time;
Expand All @@ -16,7 +16,8 @@
/**
* 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.
* Additional enhancements have been done to this input widget and plugin by Krajee to fix various bugs, and also
* provide compatibility with Bootstrap 3.
*
* @author Kartik Visweswaran <[email protected]>
* @since 1.0
Expand All @@ -31,15 +32,15 @@ class TimePicker extends InputWidget
public $size;

/**
* @var string/boolean the addon content
* @var string|boolean the addon content
*/
public $addon = '<i class="glyphicon glyphicon-time"></i>';

/**
* @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']
* @var array HTML attributes for the addon container. The following special options are recognized:
* - `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']`.
*/
public $addonOptions = [];

Expand Down Expand Up @@ -105,7 +106,7 @@ protected function renderInput()
}

/**
* Registers the needed assets
* Registers the client assets for [[Timepicker]] widget
*/
public function registerAssets()
{
Expand Down
2 changes: 1 addition & 1 deletion TimePickerAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
* @package yii2-widgets
* @subpackage yii2-widget-timepicker
* @version 1.0.2
* @version 1.0.3
*/

namespace kartik\time;
Expand Down
12 changes: 6 additions & 6 deletions assets/js/bootstrap-timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@
this.second = seconds;
this.meridian = meridian;

this.update(false);
this.update(true);

} else if (defaultTime === false) {
this.hour = 0;
Expand Down Expand Up @@ -688,7 +688,7 @@
this.meridian = this.meridian === 'AM' ? 'PM' : 'AM';
this.update();
},
update: function (trigChange) {
update: function (skipChange) {
this.$element.trigger({
'type': 'changeTime.timepicker',
'time': {
Expand All @@ -700,13 +700,13 @@
}
});

this.updateElement(trigChange);
this.updateElement(skipChange);
this.updateWidget();
},
updateElement: function (trigChange) {
updateElement: function (skipChange) {
var $el = this.$element;
$el.val(this.getTime())
if (trigChange) {
$el.val(this.getTime());
if (!skipChange) {
$el.change();
}
},
Expand Down
2 changes: 1 addition & 1 deletion assets/js/bootstrap-timepicker.min.js

Large diffs are not rendered by default.

0 comments on commit 203aeb9

Please sign in to comment.