Bug fix for date not being constrained between startDate and endDate

Fixed the issue where date was not being constrained between startDate and endDate by setting date in update() in the same manner in which viewDate is set.

Added tests. All are passing.