Imam Nawawi (Allah have mercy on him) said in his Majmu` Sharh al-Muhadhdhab:
“Abul Qasim al-Junayd (Allah have mercy on him) said, “A sincere person
changes forty times a day, while the hypocritical show-off stays as he
is forty years.”
The meaning of this is that the sincere person moves with what is
right, wherever it may lead, such that when prayer is deemed better by
the Sacred Law, then he prays, and when it is best to be sitting with
the learned, or the righteous, or guests, or his children, or taking
care of something a Muslim needs, or mending a broken heart, or
whatever else it may be, then he does it, leaving aside what he usually
does. And likewise for fasting, reciting the Koran, invoking Allah,
eating or drinking, being serious or joking, enjoying the good life or
engaging in self-sacrifice, and so on.
Whenever he sees what is preferred by the Sacred Law under the
circumstances, he does it, and is not bound by a particular habit or
kind of devotion as the show-off is.
The Prophet (Allah bless him and give him peace) did various things of
prayer, fasting, sitting for Koran recital and invocation, eating and
drinking, dressing, riding, lovemaking with his wives, seriousness and
jest, happiness and wrath, scathing condemnation for blameworthy
things, leniency in punishing those who deserved it and excusing them,
and so ion, according to what was possible and preferable for the time
(al-Majmu’ (),1.17- 18, from Shaykh N.M Keller’s translation of Reliance of the Traveller, c2.6).