Skip to content

Commit 04d16ee

Browse files
committed
Update dependencies and add test to make sure package.json and bower.json versions are in sync.
1 parent 22281d8 commit 04d16ee

File tree

6 files changed

+71
-48
lines changed

6 files changed

+71
-48
lines changed

.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+
}

README.md

+20-22
Original file line numberDiff line numberDiff line change
@@ -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

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"test*"
2424
],
2525
"dependencies": {
26-
"angular": "~1.3.14",
27-
"moment": "^2.9.0"
26+
"angular": "^1.4.4",
27+
"moment": "^2.10.6"
2828
},
2929
"devDependencies": {
3030
"angular-mocks": "~1.3.14",

gulpfile.js

+18-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
var gulp = require('gulp');
66
var jscs = require('gulp-jscs');
77
var jshint = require('gulp-jshint');
8-
var karma = require('karma').server;
8+
var Server = require('karma').Server;
99
var karmaConfig = __dirname + '/karma.conf.js';
1010
var lodash = require('lodash');
1111
var paths = require('./paths');
@@ -31,21 +31,33 @@ var testConfig = function (options) {
3131
};
3232

3333
gulp.task('test', function (done) {
34-
karma.start(testConfig(
34+
35+
var config = testConfig(
3536
{
3637
configFile: karmaConfig,
3738
singleRun: true,
3839
reporters: ['progress', 'coverage', 'threshold']
3940
}
40-
), done);
41+
);
42+
43+
var server = new Server(config, done);
44+
server.start();
4145
});
4246

4347
gulp.task('tdd', function (done) {
4448
gulp.watch(paths.all, ['lint']);
4549

46-
karma.start({
47-
configFile: karmaConfig
48-
}, done);
50+
var config = testConfig(
51+
{
52+
autoWatch: true,
53+
browsers: ['PhantomJS'],
54+
configFile: karmaConfig,
55+
singleRun: false
56+
}
57+
);
58+
59+
var server = new Server(config, done);
60+
server.start();
4961
});
5062

5163
gulp.task('lint', function () {

package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@
1010
"homepage": "http://dalelotts.github.io/angular-bootstrap-datetimepicker",
1111
"main": "src/js/datetimepicker.js",
1212
"dependencies": {
13-
"angular": "^1.3.16",
14-
"bower": "latest",
15-
"moment": "^2.10.3"
13+
"angular": "^1.4.4",
14+
"moment": "^2.10.6"
1615
},
1716
"devDependencies": {
17+
"bower": "latest",
1818
"grunt": "^0.4.4",
19-
"grunt-bump": "^0.3.0",
19+
"grunt-bump": "^0.3.2",
2020
"gulp": "^3.8.11",
21-
"gulp-jscs": "^1.4.0",
22-
"gulp-jshint": "^1.9.4",
21+
"gulp-jscs": "^2.0.0",
22+
"gulp-jshint": "^1.11.2",
2323
"jshint": "^2.6.0",
2424
"jshint-stylish": "^2.0.1",
25-
"karma": "^0.12.31",
26-
"karma-chrome-launcher": "^0.1.5",
27-
"karma-coverage": "^0.4.2",
25+
"karma": "^0.13.9",
26+
"karma-chrome-launcher": "^0.2.0",
27+
"karma-coverage": "^0.5.0",
2828
"karma-firefox-launcher": "^0.1.3",
29-
"karma-jasmine": "^0.3.2",
30-
"karma-phantomjs-launcher": "^0.2.0",
29+
"karma-jasmine": "^0.3.6",
30+
"karma-phantomjs-launcher": "^0.2.1",
3131
"karma-threshold-reporter": "^0.1.12",
32-
"lodash": "^3.5.0",
32+
"lodash": "^3.10.1",
3333
"matchdep": "^0.3.0",
34-
"phantomjs": "^1.9.12",
34+
"phantomjs": "^1.9.18",
3535
"plato": "^1.5.0",
3636
"run-browser": "^2.0.2",
37-
"tape": "^4.0.0"
37+
"tape": "^4.2.0"
3838
},
3939
"scripts": {
4040
"test": "npm run test-browserify && gulp",

test/commonjs/browserify.test.js

+12
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,15 @@ tapeTest('can load module after requiring', function (t) {
2222
t.doesNotThrow(loadModule);
2323
t.end();
2424
});
25+
26+
tapeTest('package and bower dependencies & version match', function (t) {
27+
'use strict';
28+
29+
var packageFile = require('../../package.json');
30+
var bowerFile = require('../../bower.json');
31+
32+
t.equal(packageFile.version, bowerFile.version, 'Version mismatch');
33+
t.equal(packageFile.dependencies.angular, bowerFile.dependencies.angular, 'Angular mismatch');
34+
t.equal(packageFile.dependencies.moment, bowerFile.dependencies.moment, 'moment mismatch');
35+
t.end();
36+
});

0 commit comments

Comments
 (0)