create method of checking date type