These two annual festivals were initiated by the Prophet (pbuh),
according to the directives of God. A few annual festivals have been
mentioned in the books of history as a part of the socio-religious
tradition of the Arab polytheists. In the same manner, a few celebrations
have also remained a part of the Jewish traditions, however, according
to the Torah and other scriptures, it is clear that all these festivals
were, in fact, in commemoration of certain events of national significance
in the history of the Israelites. Through the last revelation of His
guidance to man, God promulgated the two Eid days as religious celebrations.
Both these celebrations, which God recognized and promoted in His
final Shari`ah, through the Prophet (pbuh), are connected to the two
most significant events of submission to God's will and piety. Eid
al-Fitr is celebrated every year at the end of the month of Ramadhan
(the month of fasting), on the first day of Shawwal (the month following
the month of Ramadhan), after the Muslims have completed the prescribed
fasting during Ramadhan. Eid al-Adha is celebrated on the 10th of
Dhulhajj (the last month of the Muslim calendar, during which the
Muslims undertake the pilgrimage of the Ka`bah), in commemoration
of the great sacrifice of Abraham (pbuh).
According to some historical narratives, it has been reported that
both these festivals were first initiated after the Prophet (pbuh)'s
migration and the establishment of the first Muslim state in Medinah.
In one such narrative, Hadhrat Anas (ra) is reported to have said:

When the Prophet (pbuh) reached Medinah,
people used to observe two festivals, in which they would play games
and have fun. The Prophet (pbuh) asked them: 'What is the significance
of these two days?' People told him: 'Since the pre-Islamic days,
these have been our days of celebration and games'. The Prophet (pbuh)
said: God has replaced these days with two other days: the day of
the Eid al-Adha and the day of the Eid al-Fitr.
A few actions were promulgated by the Prophet (pbuh) through his Sunnah
for all Muslims to observe with reference to these days. These actions
include:
1 . Zaka'h al-Fitr;
2 . The address and the prayer
on the Eid days; and
3 . Declaring God's praise and
His greatness, after each prayer during the three days following the
Eid al-Adha.
The Zaka'h al-Fitr is to be paid during the last days of Ramadhan,
before the Eid. The amount to be paid as Zaka'h al-Fitr has been prescribed
at one day's food requirements of a person. It is to be paid for each
person, whether young or old, in one's household. During the days
of the Prophet (pbuh), it was, generally, prescribed in terms of grain.
It was prescribed by the Prophet (pbuh) at approximately two and a
half kilograms of any of the more popular grains. According to one
of the narratives reported by Bukhari:

The Prophet (pbuh) prescribed Zaka'h al-Fitr
at a Saa`[27] of dates or barley upon every Muslim: whether slave
or free, man or woman, grown-up or a child. He also directed that
it should be distributed before going for prayers on the Eid day.
According to Abd Allah ibn Abbas (ra), the Prophet (pbuh) prescribed
the payment of the Zaka'h al-Fitr as atonement or penance for any
wrongdoings during the month of Ramadhan as well as for making arrangements
for the food of the deprived[29].
The details regarding the Eid address and prayer shall be covered
in the article regarding the 'Forms of Islamic Worship'.
Praising and glorifying God after each prayer has been prescribed
without fixing any specific words for such praise and glorification.
This implies that any words may be used for such declaration[30].
The days during which such declaration is formally prescribed are
the same, which have been prescribed for staying at Minaa, after the
sacrifice during Hajj. These days are also considered to be a part
of the Eid celebrations after the 10th of Dhul Hajj.
Both the festivals of Eid al-Fitr and Eid al-Adhaa are special occasions
for the remembrance of God and expressing gratitude towards Him as
well as for celebration, enjoyment and entertainment. According to
Hadhrat Ayesha (ra), once when Abu Bakr (ra) tried to stop some young
girls from singing songs in the Prophet (pbuh)'s house, he said:
Abu
Bakr, every nation has a day of celebration. This is our day of celebration
[therefore, let these girls entertain themselves].
According to some of the narratives reported in the various compilations,
the Prophet (pbuh)'s general routine on these days was as under:
1 . On the day of Eid al-Fitr,
the Prophet (pbuh) would eat a few dates (in odd numbers) before leaving
for the Eid congregation and praye .
2 . On the day of Eid al-Adhaa,
the Prophet (pbuh) would not eat anything before the Eid congregation
and prayer .
3 . On both these occasions,
the Prophet (pbuh) would take a separate route while approaching and
returning from the place of the Eid congregation and prayers .