Add valid ranges for day based on selected month and year taking into account leap years. With this change it should no longer be possible to enter an invalid date.