Skip to content

Commit d57ec85

Browse files
committed
Merge branch 'release/0.3.14'
2 parents e37ad9f + 03819ce commit d57ec85

21 files changed

+223
-755
lines changed

.csslintrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"adjoining-classes": false
3+
}

.jscsrc

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"preset": "crockford",
32
"disallowDanglingUnderscores": { "allExcept": ["_$compile_", "_$rootScope_"] },
43
"disallowMultipleVarDecl": "strict",
5-
"validateIndentation": 2,
6-
"requireMultipleVarDecl": null
7-
}
4+
"preset": "crockford",
5+
"requireMultipleVarDecl": null,
6+
"requireVarDeclFirst": null,
7+
"validateIndentation": 2
8+
}

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: node_js
2+
sudo: false
23
node_js:
34
- '0.12'
45
branches:

README.md

+22-24
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Angular bootstrap date & time picker version: 0.3.13
2-
================================
1+
# Angular bootstrap date & time picker version: 0.3.14
32

43
Native AngularJS datetime picker directive styled by Twitter Bootstrap 3
54

65
[![MIT License][license-image]][license-url]
76
[![Build Status](https://travis-ci.org/dalelotts/angular-bootstrap-datetimepicker.png?branch=master)](https://travis-ci.org/dalelotts/angular-bootstrap-datetimepicker)
7+
[![Dependency Status](https://david-dm.org/dalelotts/angular-bootstrap-datetimepicker.svg)](https://david-dm.org/dalelotts/angular-bootstrap-datetimepicker)
88
[![devDependency Status](https://david-dm.org/dalelotts/angular-bootstrap-datetimepicker/dev-status.png)](https://david-dm.org/dalelotts/angular-bootstrap-datetimepicker#info=devDependencies)
99
[![PayPal donate button](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=F3FX5W6S2U4BW&lc=US&item_name=Dale%20Lotts&item_number=angular%2dbootstrap%2ddatetimepicker&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted "Donate one-time to this project using Paypal")
1010
<a href="https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Fabout.twitter.com%2Fresources%2Fbuttons&amp;text=Check%20out%20this%20%23AngularJS%20directive%20that%20makes%20it%20dead%20simple%20for%20users%20to%20select%20dates%20%26%20times&amp;tw_p=tweetbutton&amp;url=https%3A%2F%2Fgithub.com%2Fdalelotts%2Fangular-bootstrap-datetimepicker&amp;via=dalelotts" target="_blank">
@@ -14,27 +14,6 @@ Native AngularJS datetime picker directive styled by Twitter Bootstrap 3
1414

1515
[Home / demo page](http://dalelotts.github.io/angular-bootstrap-datetimepicker/)
1616

17-
# Upgrading to 0.3.x
18-
19-
<code>weekStart</code> has been removed. This directive uses the locale aware
20-
[moment.js day of week](http://momentjs.com/docs/#/get-set/weekday/) to
21-
determine which day is the first day of the week. If you would like a first
22-
day of week that is not standard for the locale you can create a
23-
[custom locale](http://momentjs.com/docs/#/customization/)
24-
25-
## Easier to control width
26-
27-
The width of the entire control is set in css, which you can easily override.
28-
29-
## Better localization support
30-
31-
This directive uses localized date formats when available. One exception is the title
32-
of the month view - moment does not (yet) have a localized format for month and year.
33-
34-
# (Almost) Complete re-write
35-
36-
This project started as an AngularJS specific re-write of the [bootstrap-datetimepicker project](https://github.com/smalot/bootstrap-datetimepicker).
37-
Only the CSS file from the bootstrap-datetimepicker project was re-used.
3817

3918
#Dependencies
4019

@@ -47,6 +26,8 @@ optional:
4726
* bootstrap's dropdown component (`dropdowns.less`)
4827

4928
#Testing
29+
This directive was written using TDD and all enhancements and changes have related tests.
30+
5031
We use karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use gulp:
5132

5233
```
@@ -164,6 +145,12 @@ data-on-set-time="onTimeSet" <-- **This will NOT work, the ()'s are required*
164145

165146

166147
## Configuration Options
148+
***NOTE*** The configuration optionss are not attributes on the element but rather members of the configuration object,
149+
which is specified in the data-datetimepicker-config attribute.
150+
151+
```html
152+
<datetimepicker data-ng-model="data.date" data-datetimepicker-config="{ dropdownSelector: '.dropdown-toggle' }"></datetimepicker>
153+
```
167154

168155
### startView
169156

@@ -262,11 +249,19 @@ In this example, the drop-down functionality is controlled by Twitter Bootstrap.
262249
The <code>dropdownSelector</code> tells the datetimepicker which element is bound to the Twitter Bootstrap drop-down so
263250
the drop-down is toggled closed after the user selectes a date/time.
264251

265-
## I18N
252+
253+
## I18N / l10n support
266254

267255
All internationalization is handled by Moment.js, see Moment's documentation for details.
268256
In most cases, all that is needed is a call to ```moment.locale(String)```
269257

258+
One exception is the title of the month view - moment does not (yet) have a localized format for month and year.
259+
260+
```JavaScript
261+
moment.locale('en'); // English
262+
moment.locale('zh-cn'); // Simplified chinese
263+
```
264+
270265
# Screenshots
271266

272267
## Year view
@@ -305,6 +300,9 @@ This view allows the user to select a specific time of day, in the selected hour
305300
By default, the time is displayed in 5 minute increments. The <code>minuteStep</code> property controls the increments of time displayed.
306301
If the minute view is the minView, which is is by default, the date will be set to the beginning of the hour on the day selected.
307302

303+
##Contributing
304+
305+
308306
## License
309307

310308
angular-bootstrap-datetimepicker is freely distributable under the terms of the [MIT license](LICENSE).

bower.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-bootstrap-datetimepicker",
3-
"version": "0.3.13",
3+
"version": "0.3.14",
44
"description": "This directive allows you to add a datetime-picker to your form.",
55
"author": "https://github.com/dalelotts/angular-bootstrap-datetimepicker/graphs/contributors",
66
"license": "MIT",
@@ -23,12 +23,12 @@
2323
"test*"
2424
],
2525
"dependencies": {
26-
"angular": "~1.3.14",
27-
"moment": "^2.9.0"
26+
"angular": "^1.4.7",
27+
"moment": "^2.10.6"
2828
},
2929
"devDependencies": {
30-
"angular-mocks": "~1.3.14",
31-
"bootstrap": "^3.3.1",
32-
"jquery": "^2.1.3"
30+
"angular-mocks": "^1.4.7",
31+
"bootstrap": "^3.3.5",
32+
"jquery": "^2.1.4"
3333
}
3434
}

demo/index.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
3232
<meta name="theme-color" content="#ffffff">
3333

34-
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
34+
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.css">
3535
<link rel="stylesheet" href="src/css/datetimepicker.css">
36-
<script type="text/javascript" src="bower_components/jquery/dist/jquery.js"></script>
37-
<script type="text/javascript" src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
38-
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
39-
<script type="text/javascript" src="bower_components/moment/moment.js"></script>
40-
<script type="text/javascript" src="bower_components/moment/locale/de.js"></script>
41-
<script type="text/javascript" src="bower_components/moment/locale/zh-cn.js"></script>
36+
<script type="text/javascript" src="node_modules/jquery/dist/jquery.js"></script>
37+
<script type="text/javascript" src="node_modules/bootstrap/dist/js/bootstrap.js"></script>
38+
<script type="text/javascript" src="node_modules/angular/angular.js"></script>
39+
<script type="text/javascript" src="node_modules/moment/moment.js"></script>
40+
<script type="text/javascript" src="node_modules/moment/locale/de.js"></script>
41+
<script type="text/javascript" src="node_modules/moment/locale/zh-cn.js"></script>
4242
<script type="text/javascript" src="demo/demo-app.js"></script>
4343
<script type="text/javascript" src="demo/demo-controller.js"></script>
4444
<script type="text/javascript" src="src/js/datetimepicker.js"></script>

gulpfile.js

+29-8
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
/* jshint node:true */
33
'use strict';
44

5+
var csslint = require('gulp-csslint');
56
var gulp = require('gulp');
67
var jscs = require('gulp-jscs');
78
var jshint = require('gulp-jshint');
8-
var karma = require('karma').server;
99
var karmaConfig = __dirname + '/karma.conf.js';
1010
var lodash = require('lodash');
1111
var paths = require('./paths');
1212
var plato = require('plato');
13+
var Server = require('karma').Server;
1314

1415
gulp.task('complexity', function (done) {
1516

@@ -20,6 +21,14 @@ gulp.task('complexity', function (done) {
2021
plato.inspect(paths.lint, 'complexity', {title: 'prerender', recurse: true}, callback);
2122
});
2223

24+
25+
gulp.task('csslint', function () {
26+
return gulp.src(paths.css)
27+
.pipe(csslint())
28+
.pipe(csslint.reporter())
29+
.pipe(csslint.failReporter());
30+
});
31+
2332
var testConfig = function (options) {
2433
var travisOptions = process.env.TRAVIS &&
2534
{
@@ -31,21 +40,33 @@ var testConfig = function (options) {
3140
};
3241

3342
gulp.task('test', function (done) {
34-
karma.start(testConfig(
43+
44+
var config = testConfig(
3545
{
3646
configFile: karmaConfig,
3747
singleRun: true,
3848
reporters: ['progress', 'coverage', 'threshold']
3949
}
40-
), done);
50+
);
51+
52+
var server = new Server(config, done);
53+
server.start();
4154
});
4255

4356
gulp.task('tdd', function (done) {
44-
gulp.watch(paths.all, ['lint']);
57+
gulp.watch(paths.all, ['jscs', 'lint', 'csslint']);
58+
59+
var config = testConfig(
60+
{
61+
autoWatch: true,
62+
browsers: ['PhantomJS'],
63+
configFile: karmaConfig,
64+
singleRun: false
65+
}
66+
);
4567

46-
karma.start({
47-
configFile: karmaConfig
48-
}, done);
68+
var server = new Server(config, done);
69+
server.start();
4970
});
5071

5172
gulp.task('lint', function () {
@@ -63,4 +84,4 @@ gulp.task('jscs', function () {
6384
.pipe(jscs('.jscsrc'));
6485
});
6586

66-
gulp.task('default', ['jscs', 'lint', 'complexity', 'test']);
87+
gulp.task('default', ['jscs', 'lint', 'csslint', 'complexity', 'test']);

karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = function (config) {
5656
// the configure thresholds
5757
thresholdReporter: {
5858
statements: 100,
59-
branches: 96.9,
59+
branches: 97,
6060
functions: 100,
6161
lines: 100
6262
},

package.json

+23-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-bootstrap-datetimepicker",
3-
"version": "0.3.13",
3+
"version": "0.3.14",
44
"description": "This directive allows you to add a datetime-picker to your form elements.",
55
"author": "https://github.com/dalelotts/ng-bootstrap-datetimepicker/graphs/contributors",
66
"bugs": {
@@ -10,36 +10,40 @@
1010
"homepage": "http://dalelotts.github.io/angular-bootstrap-datetimepicker",
1111
"main": "src/js/datetimepicker.js",
1212
"dependencies": {
13-
"angular": "^1.3.14",
14-
"bower": "latest",
15-
"moment": "^2.9.0"
13+
"angular": "^1.4.7",
14+
"moment": "^2.10.6"
1615
},
1716
"devDependencies": {
17+
"angular-mocks": "^1.4.7",
18+
"bootstrap": "^3.3.5",
19+
"bower": "latest",
20+
"csslint": "^0.10.0",
1821
"grunt": "^0.4.4",
19-
"grunt-bump": "^0.3.0",
22+
"grunt-bump": "^0.6.0",
2023
"gulp": "^3.8.11",
21-
"gulp-jscs": "^1.4.0",
22-
"gulp-jshint": "^1.9.4",
24+
"gulp-csslint": "^0.2.0",
25+
"gulp-jscs": "^3.0.0",
26+
"gulp-jshint": "^1.11.2",
27+
"jquery": "^2.1.4",
2328
"jshint": "^2.6.0",
24-
"jshint-stylish": "^1.0.1",
25-
"karma": "^0.12.31",
26-
"karma-chrome-launcher": "^0.1.5",
27-
"karma-coverage": "^0.2.1",
29+
"jshint-stylish": "^2.0.1",
30+
"karma": "^0.13.10",
31+
"karma-chrome-launcher": "^0.2.0",
32+
"karma-coverage": "^0.5.0",
2833
"karma-firefox-launcher": "^0.1.3",
29-
"karma-jasmine": "^0.3.2",
30-
"karma-phantomjs-launcher": "^0.1.2",
34+
"karma-jasmine": "^0.3.6",
35+
"karma-phantomjs-launcher": "^0.2.1",
3136
"karma-threshold-reporter": "^0.1.12",
32-
"lodash": "^3.5.0",
33-
"matchdep": "^0.3.0",
34-
"phantomjs": "^1.9.12",
37+
"lodash": "^3.10.1",
38+
"matchdep": "^1.0.0",
39+
"phantomjs": "^1.9.18",
3540
"plato": "^1.5.0",
3641
"run-browser": "^2.0.2",
37-
"tape": "^3.5.0"
42+
"tape": "^4.2.0"
3843
},
3944
"scripts": {
4045
"test": "npm run test-browserify && gulp",
41-
"test-browserify": "run-browser test/commonjs/browserify.test.js -b",
42-
"postinstall": "./node_modules/bower/bin/bower install"
46+
"test-browserify": "run-browser test/commonjs/browserify.test.js -b"
4347
},
4448
"repository": {
4549
"type": "git",

paths.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
/* jshint node:true */
22

3-
var bower = [
4-
'bower_components/jquery/dist/jquery.js',
5-
'bower_components/moment/moment.js',
6-
'bower_components/moment/locale/*.js',
7-
'bower_components/bootstrap/dist/js/bootstrap.js',
8-
'bower_components/angular/angular.js',
9-
'bower_components/angular-mocks/angular-mocks.js'
3+
var modules = [
4+
'node_modules/jquery/dist/jquery.js',
5+
'node_modules/moment/moment.js',
6+
'node_modules/moment/locale/*.js',
7+
'node_modules/bootstrap/dist/js/bootstrap.js',
8+
'node_modules/angular/angular.js',
9+
'node_modules/angular-mocks/angular-mocks.js'
1010
];
11-
var bumpFiles = ['package.json', 'bower.json', 'README.md', 'src/js/*.js', 'src/css/*.css'];
12-
var miscFiles = ['GruntFile.js', 'gulpfile.js', 'karma.conf.js', 'paths.js'];
11+
var bumpFiles = ['package.json', 'bower.json', 'README.md', 'src/js/*.js'];
12+
var cssFiles = ['src/css/*.css'];
1313
var demoFiles = ['demo/**/*.js'];
14+
var miscFiles = ['GruntFile.js', 'gulpfile.js', 'karma.conf.js', 'paths.js'];
1415
var sourceFiles = ['src/**/*.js'];
1516
var testFiles = ['test/**/*.spec.js'];
1617

1718
module.exports = {
18-
all: bower.concat(sourceFiles).concat(testFiles).concat(demoFiles),
19+
all: modules.concat(sourceFiles).concat(testFiles).concat(demoFiles),
1920
app: sourceFiles,
20-
bump: bumpFiles,
21+
bump: bumpFiles.concat(cssFiles),
22+
css: cssFiles,
2123
lint: miscFiles.concat(sourceFiles).concat(testFiles).concat(miscFiles),
2224
src: sourceFiles,
2325
test: testFiles

0 commit comments

Comments
 (0)