It was narrated from Ka’b bin ‘Asim that the Messenger of Allah (ﷺ) said:
‘It is not an act of righteousness to fast while traveling.”