Skip to content

Commit

Permalink
Revert "Revert peerDependency breaking change"
Browse files Browse the repository at this point in the history
This reverts commit e5a3b14.
  • Loading branch information
gf3 committed Jun 1, 2015
1 parent b4f3262 commit 9696d0c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = function(grunt) {
to: ''
},
{
from: 'module.exports = moment;',
from: 'module.exports = DateRange;',
to: ''
}]
}
Expand All @@ -58,8 +58,8 @@ module.exports = function(grunt) {
all: {
src: 'dist/moment-range.js',
dest: 'dist/moment-range.js',
globalAlias: 'moment',
objectToExport: 'moment',
globalAlias: 'DateRange',
objectToExport: 'DateRange',
deps: {
default: ['moment']
}
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,18 +310,16 @@ Or put it in your `package.json`:
{ "moment-range": "~1" }
```
And then simply `require` it:
``` javascript
var moment = require('moment-range');
```
**Note:** Include `moment-range` _after_ `moment`.
### Bower
``` sh
bower install moment-range
```
**Note:** Include `moment-range` _after_ `moment`.
## Running Tests
Expand Down
6 changes: 3 additions & 3 deletions dist/moment-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define(["moment"], function (a0) {
return (root['moment'] = factory(a0));
return (root['DateRange'] = factory(a0));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require("moment"));
} else {
root['moment'] = factory(moment);
root['DateRange'] = factory(moment);
}
}(this, function (moment) {

Expand Down Expand Up @@ -362,6 +362,6 @@ moment.fn.within = function(range) {



return moment;
return DateRange;

}));
2 changes: 1 addition & 1 deletion dist/moment-range.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/moment-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,4 @@ moment.fn.within = function(range) {
// Export
//-----------------------------------------------------------------------------

module.exports = moment;
module.exports = DateRange;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"mocha": "^2.1.0",
"should": "^5.0.1"
},
"dependencies": {
"peerDependencies": {
"moment": ">= 1"
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions test/moment-range.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* jshint node: true, maxlen: 200, -W030 */
/* global describe, it */

var should = require('should');
var moment = require('../lib/moment-range');
var should = require('should');
var moment = require('moment');
require('../lib/moment-range');

describe('Moment', function() {
var dr = moment.range(new Date(Date.UTC(2011, 2, 5)), new Date(Date.UTC(2011, 5, 5)));
Expand Down

0 comments on commit 9696d0c

Please sign in to comment.