The Messenger of Allah ﷺ said, "When any of you is fasting, let him not engage in obscene speech or behave foolishly. If someone acts ignorantly toward him, let him say, 'I am a man who is fasting.'"
حدثنا يحيى بن إسحاق قال أخبرنيه أبو بكر بن عياش عن أبي حصين عن أبي صالح
قال رسول الله ﷺ إذا كان يوم صوم أحدكم فلا يرفث ولا يجهل فإن جهل عليه فليقل إني امرؤ صائم
Its isnad is sahih. It was mentioned previously at 2/356 T. It is also found in Bukhari 3/24, in the Book of Fasting, in the chapter "Should he say, 'I am fasting,' when he is cursed," and in Muslim 1/107, number 1151m.