Gianni Chiappetta

Results 99 comments of Gianni Chiappetta

ping @IvanGoncharov: this issue affects anyone using GeoJSON which is built into many databases including MongoDB. seems like a relatively straightforward fix for someone familiar with the codebase

what is the expected return value when the subtracted ranges aren't consecutive? e.g.: ```js const coreRange = moment.range('2017-01-01', '2017-12-31'); const exceptionDates = [ moment.range('2017-04-10', '2017-04-15'), moment.range('2017-04-05', '2017-04-08'), moment.range('2017-02-01', '2017-05-01'), moment.range('2017-04-13',...

@mx781 yes—specifically which ranges though?

@fancydev18 @dbettini i'm not opposed to adding it—i just want to be sure we've covered all the cases. with the current implementation i believe there are some cases that don't...

the constructor could implicitly do this? thoughts?

what if we built an insane query-builder for range testing?? e.g. api: ``` js range.starts().within(1).day().after(otherRange); range.starts(1).week().before(otherRange); range.ends().within(3).hours().after(otherRange); range.is().within(2).days().of(otherRange); // `.of()` functions like both before()/after() ```

I guess this would depend on if the [ranges are considered open or closed](http://en.wikipedia.org/wiki/Interval_%28mathematics%29#Terminology). My interval math is a bit rusty, but I think intervals relating to times/dates are generally...

one of the issues i can think of here is knowing where to slice an interval if it is right-closed; would it be one millisecond prior to the end date?

@kcfgl so this relates to my comment above yours—at what precision does one slice the dates? in your case you'd like to slice at the `day` level, but our dates...

@kcfgl when slicing ranges moment-range will slice them down to the smallest possible unit: milliseconds. you need to consider this when subtracting ranges. i've created a code sample below with...