حَدَّثَنِي يَحْيَى بْنُ يَحْيَى، وَمُحَمَّدُ بْنُ رُمْحٍ، قَالاَ أَخْبَرَنَا اللَّيْثُ، ح وَحَدَّثَنَا قُتَيْبَةُ بْنُ، سَعِيدٍ حَدَّثَنَا لَيْثٌ، عَنِ ابْنِ شِهَابٍ، عَنْ عُبَيْدِ اللَّهِ بْنِ عَبْدِ اللَّهِ بْنِ عُتْبَةَ، عَنِ ابْنِ عَبَّاسٍ، - رضى الله عنهما - أَنَّهُ أَخْبَرَهُ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم خَرَجَ عَامَ الْفَتْحِ فِي رَمَضَانَ فَصَامَ حَتَّى بَلَغَ الْكَدِيدَ ثُمَّ أَفْطَرَ وَكَانَ صَحَابَةُ رَسُولِ اللَّهِ صلى الله عليه وسلم يَتَّبِعُونَ الأَحْدَثَ فَالأَحْدَثَ مِنْ أَمْرِهِ ‏.‏
Translation
Jabir b. 'Abdullah (Allah be pleased with both of them) reported that in the course of a journey Allah's Messenger (ﷺ) saw a man, people crowding around him and providing him a shade. Upon this he (the Holy Prophet) said

What is the matter with him? They said: He is a person observing fast. Whereupon the Messenger of Allah (ﷺ) said: It is no righteousness that you fast on journey.