Fix changing endtime from time to datetime