Ibn Shihab (may Allah have mercy on him) said: These are the military expeditions (maghazi) of the Messenger of Allah (peace and blessings be upon him): the Battle of Badr took place in Ramadan, 2 AH. Then he (peace and blessings be upon him) fought the Battle of Uhud in Shawwal, 3 AH. In 4 AH he fought the Battle of Khandaq, which is also called al-Ahzab, and the Battle of Banu Qurayzah. Then in Sha'ban, 5 AH, he fought the Battles of Banu al-Mustaliq and Banu Lihyan; in 6 AH, the Battle of Khaybar. In Ramadan, 8 AH, the Conquest of Makkah, and in Shawwal, 8 AH, the Battle of Hunayn and the siege of the people of Ta'if. Then the narrator mentioned the rest of the hadith.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحجر / 11303