fix date() to take only string, null, moment or Date