tidepool-org/tideline — pull request #12 by jebeck (2014-02-19 04:23:09+00:00)
Title: adjustments to two week view's data domain upon navigation

container.date() modified to return a complex date object with a start, end, and center. This was necessary because when you navigated to the two-week view from the very end of the data in one-day view, you were shown 14 days of data up to and including n - 1 instead of 14 days of data up to and including n. Initializing two week view requires the end of the current domain from one day view (it was getting the center), but start and center may be useful for other future functions.

@nicolashery Let me know if you'd prefer separate methods for each of these instead: e.g., chart.getDateCenter(), chart.getDateStart(), etc. I thought this would fit best within the getCurrentDay() wrapper in chartdailyfactory.js.

Also modified two-week view so that if you navigate to two-week from a day that is less than 14 days from the beginning of the data, it will show you the first 14 days instead of blank space and the number of days it can show you.