I know of no basis for restricting it to two days in the Sunnah, though it has been reported from the Companions, may Allah be pleased with them, that they restricted it to the two days after Eid (1).
His statement, “The time for slaughter is after the Eid prayer,” indicates from his words, may Allah have mercy on him, that slaughtering before the prayer is not valid, because it takes place before its appointed time. Just as a person’s noon prayer would not count as the noon prayer if he prayed it before the sun had passed its zenith, likewise, if he offers his sacrifice before the prayer, it does not count. It is authentically reported from the Prophet, blessings and peace be upon him, in the general hadith that serves as a comprehensive principle in the Shariah: “Whoever performs an action that is not in accordance with our matter, it is rejected” (2). It is also authentically reported concerning this specific issue that “whoever slaughters before the prayer has merely presented meat to his family; it is not part of the ritual sacrifice in any way” (3). This was established from the Messenger of Allah, blessings and peace be upon him, and he proclaimed it in his Eid al-Adha sermon.
Abu Burdah, may Allah be pleased with him, mentioned to him an incident that had happened to him: he wished for his household to eat meat early in the day before he prayed, so he slaughtered his Eid sacrifice before praying. He asked the Prophet, blessings and peace be upon him, about this, and he said to him, “Your sheep is merely a sheep for meat.” Although the man was ignorant, ignorance does not excuse a person with regard to commands, unlike prohibitions. If a person commits a prohibited act out of ignorance, he is excused because of his ignorance; as for commands, this is not the case. Therefore, the Prophet, blessings and peace be upon him, did not excuse him, but rather said, “Your sheep is merely a sheep for meat,” and said, “Whoever slaughters before