Skip to content

Commit d03c0fb

Browse files
committed
Fix broken browserify support
1 parent 6245248 commit d03c0fb

File tree

7 files changed

+54
-21
lines changed

7 files changed

+54
-21
lines changed

README.md

Lines changed: 6 additions & 3 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

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",

package.json

Lines changed: 16 additions & 11 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,19 +9,21 @@
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.3.0",
17-
"grunt-complexity": "^0.3.0",
18-
"grunt-contrib-jshint": "^0.11.0",
19+
"grunt-bump": "0.0.16",
20+
"grunt-complexity": "^0.2.0",
21+
"grunt-contrib-jshint": "^0.10.0",
1922
"grunt-istanbul-coverage": "^0.1.0",
20-
"grunt-karma": "^0.10.1",
23+
"grunt-karma": "^0.9.0",
2124
"gulp": "^3.8.11",
22-
"gulp-bump": "^0.2.2",
25+
"gulp-bump": "^0.1.11",
2326
"gulp-jshint": "^1.9.0",
24-
"gulp-plato": "^1.0.1",
2527
"jshint-stylish": "^1.0.0",
2628
"karma": "^0.12.25",
2729
"karma-chrome-launcher": "^0.1.5",
@@ -31,13 +33,16 @@
3133
"karma-phantomjs-launcher": "^0.1.2",
3234
"karma-threshold-reporter": "^0.1.12",
3335
"matchdep": "^0.3.0",
34-
"phantomjs": "^1.9.12"
36+
"phantomjs": "^1.9.12",
37+
"run-browser": "^2.0.2",
38+
"tape": "^3.5.0"
3539
},
3640
"peerDependencies": {
3741
"grunt-cli": "0.1.13"
3842
},
3943
"scripts": {
40-
"test": "grunt --verbose",
44+
"test": "npm run test-browserify && gulp --verbose",
45+
"test-browserify": "run-browser test/commonjs/browserify.test.js -b",
4146
"postinstall": "./node_modules/bower/bin/bower install"
4247
},
4348
"repository": {

paths.js

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

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 test = require('tape');
7+
8+
test('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)