Separate CSV and view code, fix #1890: date-range issue.
Merge pull request #1891 from bcipolli/1890

Separate CSV and view code, fix #1890: date-range issue.