-
Notifications
You must be signed in to change notification settings - Fork 200
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
Can't iterate a range in reverse order #68
Comments
+1 |
how would you feel if moment-range automatically re-arranged your range so that start was always the min and end was always the max? |
@gf3 I'm not sure how that would help with my issue. |
@globexdesigns well it would always iterate the correct amount, just not in the reverse order |
+1 |
2 similar comments
+1 |
+1 |
+1
Modifying the lib to the below would work:
|
adding discrete methods for reverse iteration in v3, you can follow the progress here: https://github.com/gf3/moment-range/tree/3-dev example usage here thanks for your patience everyone |
* Go full-blown ES6 via webpack/babel * Flow typing * Better documentation * Remove bower * Remove grunt in favour of webpack * Remove jshint in favour of eslint * Remove mocha/should in favour of karma/mocha/expect.js * New usage: import Moment from 'moment'; import { DateRange, extendMoment } from 'moment-js'; const moment = extendMoment(Moment); * Add `by`, `reverseBy`, `byRange`, `reverseByRange` (#68) - Pass options as object - New methods use iterators - Added reversal methods - Discrete methods for different iterator types * Fix issue with `moment#within` and moment-timezone (#127) * Pass optional rounded argument in `diff` (#104) * Add ability to iterate over a range by a step (#93) * Add `adjacent` method and option to `overlaps` (#92 #112) * Update short-hand units (#134) * Add `duration` as an alias of `diff` (#64) * Update packaging rules and scripts * Fix typo in comment (#133) * Update documentation * Add documentation about range creation (thanks @seanwendt)
just opened a PR for |
* Go full-blown ES6 via webpack/babel * Flow typing * Better documentation * Remove bower * Remove grunt in favour of webpack * Remove jshint in favour of eslint * Remove mocha/should in favour of karma/mocha/expect.js * New usage: import Moment from 'moment'; import { DateRange, extendMoment } from 'moment-js'; const moment = extendMoment(Moment); * Add `by`, `reverseBy`, `byRange`, `reverseByRange` (#68) - Pass options as object - New methods use iterators - Added reversal methods - Discrete methods for different iterator types * Fix issue with `moment#within` and moment-timezone (#127) * Pass optional rounded argument in `diff` (#104) * Add ability to iterate over a range by a step (#93) * Add `adjacent` method and option to `overlaps` (#92 #112) * Update short-hand units (#134) * Add `duration` as an alias of `diff` (#64) * Update packaging rules and scripts * Fix typo in comment (#133) * Update documentation * Add documentation about range creation (thanks @seanwendt)
I want to iterate over a date range from latest to earliest date, but this doesn't seem to work:
The text was updated successfully, but these errors were encountered: