It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "When you are invited, then accept the invitation of the one who invites you." The narrator said: And Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) used to attend both wedding and non-wedding invitations, even when he was fasting, he would still attend the invitation.
Hadith Referenceسنن دارمي / من كتاب الاطعمة / 2119
Hadith Takhrijاس روایت کی سند صحیح اور حدیث متفق علیہ ہے۔ دیکھئے: [بخاري 5179] ، [مسلم 1419] ، [أبوداؤد 3726] ، [ابن حبان 5294]
Brief Explanation
(Commentary on Hadith 2118)
SubhanAllah! How magnificent is the status of following the Sunnah. The noble Companion, the ardent follower of the Sunnah and passionate lover of the Prophet, Sayyiduna Ibn Umar radi Allahu anhuma, showed such regard and respect for the statement of the Messenger of Allah sallallahu alayhi wa sallam, “Accept the invitation,” that even while observing a voluntary fast (nafl), he would accept an invitation and would not deviate in the slightest from the teaching of his beloved Prophet Muhammad sallallahu alayhi wa sallam. If only this same spirit could be awakened in today’s Muslims.
From this hadith, the ruling is derived to accept invitations, whether for a wedding or otherwise. And if one is observing a voluntary fast and is invited, then in such a situation, it is better to break the fast, because it is in obedience to the command of the Messenger sallallahu alayhi wa sallam, and this leads to mutual harmony and increases love among one another.