It is narrated from Sayyiduna Jabir (may Allah be pleased with him) that once the Prophet (peace and blessings be upon him) was on a journey. On the way, he saw that people had gathered around a man and were shading him. Upon asking, the people informed that he was fasting. So the Prophet (peace and blessings be upon him) said: Fasting while on a journey is not an act of righteousness.