Skip to content

Instantly share code, notes, and snippets.

@jugglinmike
Last active August 29, 2015 14:12
Show Gist options
  • Save jugglinmike/b77973ef5bfdcc15991a to your computer and use it in GitHub Desktop.
Save jugglinmike/b77973ef5bfdcc15991a to your computer and use it in GitHub Desktop.
Contraining date ranges with a date range

The before parameter should filter the set to only include phases that were active before the date specified (this means they started before the given date). The after parameter should filter the set to only include phases that were active after the date specified (this means they ended after the given date).

Here, only "Phase 1" would be selected because it started before the given date:

Time     -------------------->
             before
               |
               V
Phase 1:  x  x
Phase 2:         x  x
Phase 3:                x  x

Here, "Phase 2" and "Phase 3" would be selected because they ended after the given date

Time     -------------------->
             after
               |
               V
Phase 1:  x  x
Phase 2:         x  x
Phase 3:                x  x

These constraints can be used in conjunction to get phases that were active within a given window. This would select "Phase 1" and "Phase 2":

Time     -------------------->
        after       before
          |           |
          V           V
Phase 1:  x  x
Phase 2:         x  x
Phase 3:                x  x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment