The "isDateLike" function is supposed to check whether its parameter resembles a Date object. A string most certainly does not. Please revert this.