Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancements? #47

Closed
mathew-kurian opened this issue Jul 17, 2014 · 1 comment
Closed

Enhancements? #47

mathew-kurian opened this issue Jul 17, 2014 · 1 comment

Comments

@mathew-kurian
Copy link

Thank you for this great library!!! I have forked the library and added a few more features. So, if you would like to merge these changes please let me know and I can clean it up and add test cases. If there any issues, please me know. The features added are as follows:

Querying

Support for multiple subsequent add/subtract calls.

 RangeA.subtract(RangeB).subtract(RangeC).add(RangeD).by(...)

Query String

Additionally, moment.range has been modified to also support with a range query string inputs which will be converted to a DateRange. Examples of this are as follows:

  1. (2009>>2012)
  2. (2009>>2012)(^2008-2010)
  3. (January 1, 2012>>2015)

Subtraction Boundary

You can say whether you want to include/exclude the boundary dates during subtraction.

// 1 second offset from left/right of range
RangeA.subtract(RangeB).subtract(RangeC, 1, 's') 

Note: This can be done by the user quite easily, but I figured it would be awesome if the library supported it.

@gf3
Copy link
Contributor

gf3 commented Sep 23, 2014

Sorry for the delay in getting back to you (been crazy busy). I'm definitely interested in these updates. If you provide a PR with docs & tests I'd be more than happy to merge it in and add you to the contributors. Thank you!

@gf3 gf3 closed this as completed Feb 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants