format dates correctly
extract render method