Answer
Wa`alaykum as-salam wa rahmatullahi wa barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
Refraining from cutting the hair and trimming the nails is a sunnah, but it does not invalidate the udhiyah in anyway, even if the person knew that he was doing this after the beginning of Dhul-Hijjah.
In his response to your question, Sheikh `Abdul-Majeed Subh, a prominent Azharite scholar, stated,
The majority of scholars, with the exception of Hanbalis and Ibn Hazm, agree on that it is only an act of the sunnah for the one who wants to offer udhiyah to refrain from removing anything (hair or nails) when he or she sees the new moon of Dhul-Hijjah.
Additionally, even the Hanbalis, who say that it is obligatory, do not invalidate one’s udhiyah if he or she cuts his or her hair or nails. Thus, the udhiayh of those who cut their hair and/or trimmed their nails while not knowing that the moon of Dhul-Hijjah was seen is valid.
Umm Salamah reported that Prophet Muhammad (peace and blessings of Allah be upon him) said; “When you see the new moon of Dhul-Hijjah and one of you wants to offer a sacrifice, let him refrain from (removing anything) from his hair or nails.” (Muslim)
Refraining from cutting the hair and trimming the nails is a sunnah, but it does not invalidate the udhiyah in anyway, even if the person knew that he was doing this after the beginning of Dhul-Hijjah.
Once the person learns about the beginning of Dhul-Hijjah, he or she should refrain from cutting hair and trimming nails. There is neither fear nor doubt for the validity of the sacrifice and he or she will get the reward of following the sunnah.
Moreover, Sheikh Abdel Khaliq Hassan Ash-Shareef, an Egypt-based renowned scholar and da`iyah, added,
There is no impact of what they did on the validity of their sacrifice. It is only an act of the sunnah not to cut the hair or trim the nails in the first 10 days of Dhul-Hijjah for one who intends to offer a sacrifice.
📚 Read Also: First Ten Days of Dhul-Hijjah: What Should We Avoid and Do?
However, if the person cuts his or her hair or trimmed his or her nails, it is not a sin and there is nothing wrong with his or her sacrifice.
Almighty Allah knows best.
Editor’s note: This fatwa is from Ask the Scholar’s archive and was originally published at an earlier date.