ensure only valid dates can be selected