Skip to content

Commit 886656d

Browse files
committed
Updates to release v1.0.2
1 parent fa230ca commit 886656d

File tree

11 files changed

+222
-15
lines changed

11 files changed

+222
-15
lines changed

.github/CONTRIBUTING.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
Contributing to yii2-widget-timepicker
2+
======================================
3+
Looking to contribute something to yii2-widget-timepicker? **Here's how you can help.**
4+
5+
Please take a moment to review this document in order to make the contribution
6+
process easy and effective for everyone involved.
7+
8+
Following these guidelines helps to communicate that you respect the time of
9+
the developers managing and developing this open source project. In return,
10+
they should reciprocate that respect in addressing your issue or assessing
11+
patches and features.
12+
13+
Using the issue tracker
14+
-----------------------
15+
When [reporting bugs][reporting-bugs] or
16+
[requesting features][requesting-features], the
17+
[issue tracker on GitHub][issue-tracker] is the recommended channel to use.
18+
19+
The issue tracker **is not** a place for support requests. Refer the
20+
[extension documentation and demos](http://demos.krajee.com/widget-details/timepicker) and/or refer to the
21+
[webtips Q & A forum](http://webtips.krajee.com/questions) which are the better places to get help.
22+
23+
Reporting bugs with yii2-widget-timepicker
24+
------------------------------------------
25+
26+
We really appreciate clear bug reports that _consistently_ show an issue
27+
_within yii2-widget-timepicker_.
28+
29+
The ideal bug report follows these guidelines:
30+
31+
1. **Use the [GitHub issue search][issue-search]** — Check if the issue
32+
has already been reported.
33+
2. **Check if the issue has been fixed** — Try to reproduce the problem
34+
using the code in the `master` branch.
35+
3. **Isolate the problem** — Try to share a demo or a test case that
36+
consistently reproduces the problem.
37+
38+
Please try to be as detailed as possible in your bug report, especially if an
39+
isolated test case cannot be made. Some useful questions to include the answer
40+
to are:
41+
42+
- What steps can be used to reproduce the issue?
43+
- What is the bug and what is the expected outcome?
44+
- What browser(s) and Operating System have you tested with?
45+
- Does the bug happen consistently across all tested browsers?
46+
- What version of jQuery are you using? And what version of yii2-widget-timepicker?
47+
- Are you using yii2-widget-timepicker with other plugins?
48+
49+
All of these questions will help others fix and identify any potential bugs.
50+
51+
Requesting features in yii2-widget-timepicker
52+
------------------------------------------
53+
Before starting work on a major feature for yii2-widget-timepicker, **read the
54+
[documentation](http://demos.krajee.com/widget-details/timepicker) first** or you may risk spending a considerable amount of
55+
time on something which the project developers are not interested in bringing into the project.
56+
57+
### Submitting a pull request
58+
59+
We use GitHub's pull request system for submitting patches. Here are some
60+
guidelines to follow when creating the pull request for your fix.
61+
62+
1. Make sure to create a ticket for your pull request. This will serve as the
63+
bug ticket, and any discussion about the bug will take place there. Your pull
64+
request will be focused on the specific changes that fix the bug.
65+
2. Make sure to reference the ticket you are fixing within your pull request.
66+
This will allow us to close off the ticket once we merge the pull request, or
67+
follow up on the ticket if there are any related blocking issues.
68+
3. Explain why the specific change was made. Not everyone who is reviewing your
69+
pull request will be familiar with the problem it is fixing.
70+
4. Run your tests first. If your tests aren't passing, the pull request won't
71+
be able to be merged. If you're breaking existing tests, make sure that you
72+
aren't causing any breaking changes.
73+
5. Only include source changes. While it's not required, only including changes
74+
from the `src` directory will prevent merge conflicts from occuring. Making
75+
this happen can be as a simple as not committing changes from the `dist`
76+
directory.
77+
78+
By following these steps, you will make it easier for your pull request to be
79+
reviewed and eventually merged.
80+
81+
Triaging issues and pull requests
82+
---------------------------------
83+
Anyone can help the project maintainers triage issues and review pull requests.
84+
85+
### Handling new issues
86+
87+
yii2-widget-timepicker regularly receives new issues which need to be tested and organized.
88+
89+
When a new issue that comes in that is similar to another existing issue, it
90+
should be checked to make sure it is not a duplicate. Duplicates issues should
91+
be marked by replying to the issue with "Duplicate of #[issue number]" where
92+
`[issue number]` is the url or issue number for the existing issue. This will
93+
allow the project maintainers to quickly close off additional issues and keep
94+
the discussion focused within a single issue.
95+
96+
If you can test issues that are reported to yii2-widget-timepicker that contain test cases and
97+
confirm under what conditions bugs happen, that will allow others to identify
98+
what causes a bug quicker.
99+
100+
### Reviewing pull requests
101+
102+
It is very common for pull requests to be opened for issues that contain a clear
103+
solution to the problem. These pull requests should be rigorously reviewed by
104+
the community before being accepted. If you are not sure about a piece of
105+
submitted code, or know of a better way to do something, do not hesitate to make
106+
a comment on the pull request.
107+
108+
### Reviving old tickets
109+
110+
If you come across tickets which have not been updated for a while, you are
111+
encouraged to revive them. While this can be as simple as saying `:+1:`, it is
112+
best if you can include more information on the issue. Common bugs and feature
113+
requests are more likely to be fixed, whether it is by the community or the
114+
developers, so keeping tickets up to date is encouraged.
115+
116+
Licensing
117+
---------
118+
119+
It should also be made clear that **all code contributed to yii2-widget-timepicker** must be
120+
licensable under the [BSD-3 license][licensing]. Code that cannot be released
121+
under this license **cannot be accepted** into the project.
122+
123+
[issue-search]: https://github.com/kartik-v/yii2-widget-timepicker/search?q=&type=Issues
124+
[issue-tracker]: https://github.com/kartik-v/yii2-widget-timepicker/issues
125+
[licensing]: https://github.com/kartik-v/yii2-widget-timepicker/blob/master/LICENSE.md
126+
[reporting-bugs]: #reporting-bugs-with-yii2-widget-timepicker
127+
[requesting-features]: #requesting-features-in-yii2-widget-timepicker

.github/ISSUE_TEMPLATE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
## Prerequisites
2+
3+
- [ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
4+
- [ ] The issue still exists against the latest `master` branch of yii2-widget-timepicker.
5+
- [ ] This is not an usage question. I confirm having gone through and read the [documentation and demos](http://demos.krajee.com/widget-details/timepicker).
6+
- [ ] This is not a general programming / coding question. (Those should be directed to the [webtips Q & A forum](http://webtips.krajee.com/questions)).
7+
- [ ] I have attempted to find the simplest possible steps to reproduce the issue.
8+
- [ ] I have included a failing test as a pull request (Optional).
9+
10+
## Steps to reproduce the issue
11+
12+
1.
13+
2.
14+
3.
15+
16+
## Expected behavior and actual behavior
17+
18+
When I follow those steps, I see...
19+
20+
I was expecting...
21+
22+
## Environment
23+
24+
#### Browsers
25+
26+
- [ ] Google Chrome
27+
- [ ] Mozilla Firefox
28+
- [ ] Internet Explorer
29+
- [ ] Safari
30+
31+
#### Operating System
32+
33+
- [ ] Windows
34+
- [ ] Mac OS X
35+
- [ ] Linux
36+
- [ ] Mobile
37+
38+
#### Libraries
39+
40+
- jQuery version:
41+
- yii2-widget-timepicker version:
42+
43+
## Isolating the problem
44+
45+
- [ ] This bug happens [on the demos page](https://demos.krajee.com/widget-details/timepicker)
46+
- [ ] The bug happens consistently across all tested browsers
47+
- [ ] This bug happens when using yii2-widget-timepicker without other plugins.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Scope
2+
This pull request includes a
3+
4+
- [ ] Bug fix
5+
- [ ] New feature
6+
- [ ] Translation
7+
8+
## Changes
9+
The following changes were made (this change is also documented in the [change log](https://github.com/kartik-v/yii2-widget-timepicker/blob/master/CHANGE.md)):
10+
11+
-
12+
-
13+
-
14+
15+
## Related Issues
16+
If this is related to an existing ticket, include a link to it as well.

CHANGE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Change Log: `yii2-widget-timepicker`
22
====================================
33

4+
## Version 1.0.2
5+
6+
**Date:** 04-Jan-2017
7+
8+
- (enh #12): Prevent timepicker plugin triggering change on init.
9+
- Add github contribution and issue/PR logging templates.
10+
- Add branch alias for dev-master latest release.
11+
412
## Version 1.0.1
513

614
**Date:** 12-Jan-2016

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2014 - 2016, Kartik Visweswaran
1+
Copyright (c) 2014 - 2017, Kartik Visweswaran
22
Krajee.com
33
All rights reserved.
44

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ to the ```require``` section of your `composer.json` file.
3131

3232
## Latest Release
3333

34-
> NOTE: The latest version of the module is v1.0.1 released on 12-Jan-2016. Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-timepicker/blob/master/CHANGE.md) for details.
34+
> 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.
3535
3636
## Demo
3737

TimePicker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/**
4-
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2016
4+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
55
* @package yii2-widgets
66
* @subpackage yii2-widget-timepicker
7-
* @version 1.0.1
7+
* @version 1.0.2
88
*/
99

1010
namespace kartik\time;

TimePickerAsset.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
22

33
/**
4-
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2016
4+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
55
* @package yii2-widgets
66
* @subpackage yii2-widget-timepicker
7-
* @version 1.0.1
7+
* @version 1.0.2
88
*/
99

1010
namespace kartik\time;
1111

1212
use kartik\base\AssetBundle;
1313

1414
/**
15-
* Asset bundle for DateTimePicker Widget
15+
* Asset bundle for TimePicker Widget
1616
*
1717
* @author Kartik Visweswaran <[email protected]>
1818
* @since 1.0

assets/js/bootstrap-timepicker.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* Timepicker Component for Twitter Bootstrap
33
*
4-
* Improvements by: Kartik Visweswaran, Krajee.com, 2014 - 2016
4+
* Improvements by: Kartik Visweswaran, Krajee.com, 2014 - 2017
55
*
66
* Copyright 2013 Joris de Wit
77
*
@@ -561,7 +561,7 @@
561561
this.second = seconds;
562562
this.meridian = meridian;
563563

564-
this.update();
564+
this.update(false);
565565

566566
} else if (defaultTime === false) {
567567
this.hour = 0;
@@ -688,7 +688,7 @@
688688
this.meridian = this.meridian === 'AM' ? 'PM' : 'AM';
689689
this.update();
690690
},
691-
update: function () {
691+
update: function (trigChange) {
692692
this.$element.trigger({
693693
'type': 'changeTime.timepicker',
694694
'time': {
@@ -700,11 +700,15 @@
700700
}
701701
});
702702

703-
this.updateElement();
703+
this.updateElement(trigChange);
704704
this.updateWidget();
705705
},
706-
updateElement: function () {
707-
this.$element.val(this.getTime()).change();
706+
updateElement: function (trigChange) {
707+
var $el = this.$element;
708+
$el.val(this.getTime())
709+
if (trigChange) {
710+
$el.change();
711+
}
708712
},
709713
updateFromElementVal: function () {
710714
var val = this.$element.val();

0 commit comments

Comments
 (0)