change date panel to spinner
tidy
tidy
simplify updatePanelState()