Add support for restricting the viewable date range

Add support for restricting the viewable date and selection range. Fixes googlecode 158.