Fix issue with datepicker, keyboard navigation, and null dates

This fixes defect #1204.