DDF-159: Avoid missing the last day of the week/month/year in metrics reporting.

DateMidnight is essentially the start of the day, but we need the end.
DDF103/159: Add unit tests for localised dates, and for generating URLs that contain the whole week/month/year.