Skip to content

Commit e4d79e9

Browse files
committed
Merge branch 'release/0.3.12'
2 parents 0ecf820 + 80a27d1 commit e4d79e9

File tree

19 files changed

+514
-117
lines changed

19 files changed

+514
-117
lines changed

.bowerrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"directory": "bower_components"
2+
"directory": "bower_components"
33
}

.npmignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.gitignore
2+
.idea
3+
.jshintignore
4+
.jshintrc
5+
.travis.yml
6+
angular-bootstrap-datetimepicker.iml
7+
bower_components
8+
complexity
9+
coverage
10+
demo
11+
Gruntfile.js
12+
gulpfile.js
13+
karma.conf.js
14+
paths.js
15+
test

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ branches:
77
before_install:
88
- export DISPLAY=:99.0
99
- sh -e /etc/init.d/xvfb start
10-
before_script:
11-
- npm install -g bower grunt-cli
12-
- bower install
13-
script: grunt --verbose
1410
deploy:
1511
provider: npm
1612
email: dale@dalelotts.com

Gruntfile.js

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
/*globals module, require, process */
1+
/*globals module, require */
22
/*jslint vars:true */
33
module.exports = function (grunt) {
44
'use strict';
55

66
// load all grunt tasks
77
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
88

9-
// Default task.
10-
grunt.registerTask('default', ['jshint', 'complexity', 'karma', 'coverage']);
11-
12-
var testConfig = function (configFile, customOptions) {
13-
var options = {configFile: configFile, keepalive: true};
14-
var travisOptions = process.env.TRAVIS && {
15-
browsers: ['Firefox'],
16-
reporters: ['dots', 'coverage'],
17-
singleRun: true
18-
};
19-
return grunt.util._.extend(options, customOptions, travisOptions);
20-
};
21-
229
// Project configuration.
2310
grunt.initConfig({
2411
bump: {
@@ -30,56 +17,6 @@ module.exports = function (grunt) {
3017
push: false,
3118
globalReplace: false
3219
}
33-
},
34-
complexity: {
35-
generic: {
36-
src: ['src/**/*.js'],
37-
options: {
38-
breakOnErrors: false,
39-
jsLintXML: 'complexity/report.xml', // create XML JSLint-like report
40-
errorsOnly: false, // show only maintainability errors
41-
cyclomatic: [3, 7, 12], // or optionally a single value, like 3
42-
halstead: [8, 13, 20], // or optionally a single value, like 8
43-
maintainability: 100
44-
}
45-
}
46-
},
47-
coverage: {
48-
options: {
49-
thresholds: {
50-
'statements': 100,
51-
'branches': 96.9,
52-
'lines': 100,
53-
'functions': 100
54-
},
55-
dir: 'coverage',
56-
root: ''
57-
}
58-
},
59-
karma: {
60-
unit: {
61-
options: testConfig('karma.conf.js', {
62-
singleRun: true,
63-
autoWatch: true,
64-
keepalive: true,
65-
browsers: ['Chrome']
66-
})
67-
}
68-
},
69-
jshint: {
70-
files: ['src/**/*.js', 'test/**/*.js', 'demo/**/*.js'],
71-
options: {
72-
curly: true,
73-
eqeqeq: true,
74-
immed: true,
75-
latedef: true,
76-
newcap: true,
77-
noarg: true,
78-
sub: true,
79-
boss: true,
80-
eqnull: true,
81-
globals: {}
82-
}
8320
}
8421
});
8522
};

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
# Angular bootstrap date & time picker version: 0.3.11
1+
# Angular bootstrap date & time picker version: 0.3.12
22
================================
33

44
Native AngularJS datetime picker directive styled by Twitter Bootstrap 3
55

66
[![MIT License][license-image]][license-url]
77
[![Build Status](https://travis-ci.org/dalelotts/angular-bootstrap-datetimepicker.png?branch=master)](https://travis-ci.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)
9-
[![Code Climate](https://codeclimate.com/github/dalelotts/angular-bootstrap-datetimepicker.png)](https://codeclimate.com/github/dalelotts/angular-bootstrap-datetimepicker)
10-
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/dalelotts/angular-bootstrap-datetimepicker/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
9+
[![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")
10+
<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">
11+
<img src="http://jpillora.com/github-twitter-button/img/tweet.png"></img>
12+
</a>
13+
1114

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

@@ -44,14 +47,15 @@ optional:
4447
* bootstrap's dropdown component (`dropdowns.less`)
4548

4649
#Testing
47-
We use karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt:
50+
We use karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use gulp:
4851

4952
```
50-
npm install -g grunt-cli
5153
npm install
54+
npm test
5255
```
5356

54-
The karma task will try to open Chrome as a browser in which to run the tests. Make sure this is available or change the configuration in test\test.config.js
57+
The karma task will try to open Chrome as a browser in which to run the tests.
58+
Make sure Chrome is available or change the browsers setting in karma.config.js
5559

5660
#Usage
5761
We use bower for dependency management. Add

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-bootstrap-datetimepicker",
3-
"version": "0.3.11",
3+
"version": "0.3.12",
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",
@@ -24,7 +24,7 @@
2424
],
2525
"dependencies": {
2626
"angular": "~1.3.14",
27-
"moment": "^2.8.4"
27+
"moment": "^2.9.0"
2828
},
2929
"devDependencies": {
3030
"angular-mocks": "~1.3.14",

gulpfile.js

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,49 @@
55
var gulp = require('gulp');
66
var jshint = require('gulp-jshint');
77
var karma = require('karma').server;
8-
var bump = require('gulp-bump');
8+
var lodash = require('lodash');
99
var plato = require('gulp-plato');
1010
var karmaConfig = __dirname + '/karma.conf.js';
1111
var paths = require('./paths');
1212

13-
14-
gulp.task('bump', function () {
15-
return gulp.src(paths.bump)
16-
.pipe(bump())
17-
.pipe(gulp.dest('./'));
18-
});
19-
2013
gulp.task('complexity', function () {
2114
return gulp.src('src/**/*.js')
2215
.pipe(plato('complexity'));
2316
});
2417

18+
var testConfig = function (options) {
19+
var travisOptions = process.env.TRAVIS &&
20+
{
21+
browsers: ['Firefox'],
22+
reporters: ['dots', 'coverage', 'threshold']
23+
};
24+
25+
return lodash.assign(options, travisOptions);
26+
};
27+
2528
gulp.task('test', function (done) {
26-
karma.start({
27-
configFile: karmaConfig,
28-
singleRun: true,
29-
reporters: ['progress', 'coverage', 'threshold']
30-
}, done);
29+
karma.start(testConfig(
30+
{
31+
configFile: karmaConfig,
32+
singleRun: true,
33+
reporters: ['progress', 'coverage', 'threshold']
34+
}
35+
), done);
3136
});
3237

3338
gulp.task('tdd', function (done) {
3439
gulp.watch(paths.all, ['lint']);
3540

3641
karma.start({
37-
configFile: paths.karmaConfig
42+
configFile: karmaConfig
3843
}, done);
3944
});
4045

4146
gulp.task('lint', function () {
4247
return gulp
4348
.src(paths.lint)
44-
.pipe(jshint())
49+
.pipe(jshint('.jshintrc'))
50+
.pipe(jshint.reporter('default', {verbose: true}))
4551
.pipe(jshint.reporter('jshint-stylish'))
4652
.pipe(jshint.reporter('fail'));
4753
});

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-bootstrap-datetimepicker",
3-
"version": "0.3.11",
3+
"version": "0.3.12",
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": {
@@ -9,35 +9,35 @@
99
"license": "MIT",
1010
"homepage": "http://dalelotts.github.io/angular-bootstrap-datetimepicker",
1111
"main": "src/js/datetimepicker.js",
12-
"dependencies": {},
13-
"devDependencies": {
12+
"dependencies": {
13+
"angular": "^1.3.14",
1414
"bower": "latest",
15+
"moment": "^2.9.0"
16+
},
17+
"devDependencies": {
1518
"grunt": "^0.4.4",
16-
"grunt-bump": "0.0.16",
17-
"grunt-complexity": "^0.2.0",
18-
"grunt-contrib-jshint": "^0.10.0",
19-
"grunt-istanbul-coverage": "^0.1.0",
20-
"grunt-karma": "^0.9.0",
19+
"grunt-bump": "^0.3.0",
2120
"gulp": "^3.8.11",
22-
"gulp-bump": "^0.1.11",
23-
"gulp-jshint": "^1.9.0",
24-
"gulp-plato": "^1.0.1",
25-
"jshint-stylish": "^1.0.0",
26-
"karma": "^0.12.25",
21+
"gulp-jshint": "^1.9.4",
22+
"gulp-plato": "^1.0.2",
23+
"jshint": "^2.6.0",
24+
"jshint-stylish": "^1.0.1",
25+
"karma": "^0.12.31",
2726
"karma-chrome-launcher": "^0.1.5",
2827
"karma-coverage": "^0.2.1",
2928
"karma-firefox-launcher": "^0.1.3",
3029
"karma-jasmine": "^0.3.2",
3130
"karma-phantomjs-launcher": "^0.1.2",
3231
"karma-threshold-reporter": "^0.1.12",
32+
"lodash": "^3.5.0",
3333
"matchdep": "^0.3.0",
34-
"phantomjs": "^1.9.12"
35-
},
36-
"peerDependencies": {
37-
"grunt-cli": "0.1.13"
34+
"phantomjs": "^1.9.12",
35+
"run-browser": "^2.0.2",
36+
"tape": "^3.5.0"
3837
},
3938
"scripts": {
40-
"test": "grunt --verbose",
39+
"test": "npm run test-browserify && gulp",
40+
"test-browserify": "run-browser test/commonjs/browserify.test.js -b",
4141
"postinstall": "./node_modules/bower/bin/bower install"
4242
},
4343
"repository": {

paths.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ var bower = [
99
'bower_components/angular-mocks/angular-mocks.js'
1010
];
1111
var sourceFiles = ['src/**/*.js'];
12-
var testFiles = ['test/**/*.js'];
13-
var miscFiles = ['karma.conf.js', 'demo/**/*.js'];
12+
var testFiles = ['test/**/*.spec.js'];
13+
var miscFiles = ['demo/**/*.js'];
1414
var bumpFiles = ['package.json', 'bower.json', 'README.md', 'src/js/*.js', 'src/css/*.css'];
1515

1616
module.exports = {
1717
all: bower.concat(sourceFiles).concat(testFiles).concat(miscFiles),
1818
app: sourceFiles,
1919
bump: bumpFiles,
20-
lint: ['gulpfile.js'].concat(sourceFiles).concat(testFiles).concat(miscFiles),
20+
lint: ['GruntFile.js', 'gulpfile.js', 'karma.conf.js', 'paths.js', 'test/**/*.test.js'].concat(sourceFiles).concat(testFiles).concat(miscFiles),
2121
test: testFiles
2222
};

src/css/datetimepicker.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license angular-bootstrap-datetimepicker version: 0.3.11
2+
* @license angular-bootstrap-datetimepicker version: 0.3.12
33
* (c) 2013-2014 Knight Rider Consulting, Inc. http://www.knightrider.com
44
* License: MIT
55
*/

src/js/datetimepicker.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
/*globals define, jQuery */
1+
/*globals define, jQuery, module, require */
22
/*jslint vars:true */
33

44
/**
5-
* @license angular-bootstrap-datetimepicker version: 0.3.11
5+
* @license angular-bootstrap-datetimepicker version: 0.3.12
66
* (c) 2013-2014 Knight Rider Consulting, Inc. http://www.knightrider.com
77
* License: MIT
88
*/
@@ -18,6 +18,9 @@
1818
/* istanbul ignore if */
1919
if (typeof define === 'function' && /* istanbul ignore next */ define.amd) {
2020
define(['angular', 'moment'], factory); // AMD
21+
/* istanbul ignore next */
22+
} else if (typeof exports === 'object') {
23+
module.exports = factory(require('angular'), require('moment')); // CommonJS
2124
} else {
2225
factory(window.angular, window.moment); // Browser global
2326
}
@@ -169,7 +172,10 @@
169172
var result = {
170173
'currentView': 'year',
171174
'nextView': configuration.minView === 'year' ? 'setTime' : 'month',
172-
'previousViewDate': new DateObject({utcDateValue: null, display: startDecade + '-' + (startDecade + 9)}),
175+
'previousViewDate': new DateObject({
176+
utcDateValue: null,
177+
display: startDecade + '-' + (startDecade + 9)
178+
}),
173179
'leftDate': new DateObject({utcDateValue: moment.utc(startDate).subtract(9, 'year').valueOf()}),
174180
'rightDate': new DateObject({utcDateValue: moment.utc(startDate).add(11, 'year').valueOf()}),
175181
'dates': []

test/commonjs/browserify.test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*globals require */
2+
3+
/** This file is intentionally named browserify.test.js so that it is not picked up by the karma runner **/
4+
5+
var angular = require('angular');
6+
var tapeTest = require('tape');
7+
8+
tapeTest('can load module after requiring', function (t) {
9+
'use strict';
10+
11+
function loadModule() {
12+
angular.module('ui.bootstrap.datetimepicker');
13+
}
14+
15+
t.throws(loadModule);
16+
require('../../');
17+
t.doesNotThrow(loadModule);
18+
t.end();
19+
});

0 commit comments

Comments
 (0)