Checking if the date objects are moment or plain javascript Date objects before doing the comparison