Messenger of Allah ﷺ was on a journey and saw a crowd of people, and a man was being shaded (by them). He asked, "What is the matter?" They said, "He (the man) is fasting." The Prophet ﷺ said, "It is not righteousness that you fast on a journey."
كَانَ رَسُولُ اللَّهِ ﷺ فِي سَفَرٍ فَرَأَى زِحَامًا وَرَجُلاً قَدْ ظُلِّلَ عَلَيْهِ فَقَالَ مَا هَذَا فَقَالُوا صَائِمٌ فَقَالَ لَيْسَ مِنَ الْبِرِّ الصَّوْمُ فِي السَّفَرِ