check for proper type when formatting dates