fix #303 Infinite loop on datepicker