How are we going to decide this dispute?
Said after two men disputed over when a debt of money was due, unable to agree whether "by Sha'ban" meant that year or the next.
Before Islam, the Arabs had no shared calendar. Each tribe counted years from its own local milestones, such as the death of a chieftain. On top of this, powerful tribes practised al-Nasi: they swapped the sacred months around to suit themselves, which threw the months out of order. The Qur'an condemns this practice (9:37).
The Prophet ﷺ did not set up a calendar himself. The need for one came up most likely in the 17th year after the Hijrah, under the caliph Umar ibn al-Khattab RA. Two men brought him a dispute over a debt that was due "by Sha'ban." One meant the Sha'ban just passed, and the other meant Sha'ban of the following year. Around the same time, Umar RA received a letter, reportedly from Abu Musa al-Ash'ari RA or one of his governors. It said that when Umar RA gave an instruction for a certain month, they could not tell which year he meant.
Umar RA gathered the Companions (sahaba) to decide on a calendar. One or two suggested following the Roman or Persian calendar, but this was rejected. The Companions then differed over which event should mark year one. Some proposed the birth of the Prophet ﷺ, some his death, and some the Battle of Badr. Ali ibn Abi Talib RA suggested the year of the Hijrah, and Umar RA accepted this as the wisest opinion.
Next they differed over which month should begin the year. Some suggested Ramadan, Dhu al-Hijjah or Rajab. In the end Uthman ibn Affan RA settled on Muharram.
This made the year of the Hijrah the first year of the Islamic calendar, 1 AH (there is no year 0), with Muharram as its first month. Ali RA explained the choice by saying that the Hijrah was the one decisive event that changed the Muslims from being humiliated to being honored. Later scholars have tried to find a hint of this in the Qur'an (9:108), but Allah knows best.
Other events recorded in 17 AH. Their order within the year is not established; use the storyline above for the sequence.
How are we going to decide this dispute?
Said after two men disputed over when a debt of money was due, unable to agree whether "by Sha'ban" meant that year or the next.
O Umar, sometimes you tell us to do something by a particular month, but we do not know if you mean the same year's month or the next year's. Find a way to tell us.
Which year should we begin with?
Asked of the gathered sahaba after Umar ibn al-Khattab called them together to establish a calendar of their own, rather than adopt that of the Romans or Persians.
The year of the Hijrah shall be the first year of the calendar, because this was the one decisive thing that changed the Muslims from being humiliated to being honored.
This is the wisest opinion.
It shall be Muharram.
Said when the sahaba then differed over which month should open the new calendar.
“Indeed, the number of months with Allah is 12 [lunar] months in the register of Allah [from] the day He created the heavens and the earth; of these, four are sacred.”
This ayah (Q9:36), on the twelve months and the four sacred ones, is the Qur'anic basis for the lunar calendar structure established at this event -- the very next verse (9:37) is cited in the event's own description regarding al-Nasi.