Added support for date ranges when iterating over resources.

applies to #253
Merge remote-tracking branch 'origin/r/3.1.x' into r/3.1.x