BZ-11687 improved date range calculations
Merge remote-tracking branch 'refs/remotes/origin/master'