Fixes selectable date logic