After ʿAlī’s death, al-Ḥasan’s brief period of allegiance and his subsequent transfer of authority to Muʿāwiyah play an important part in the thirty-year calculation. Including his rule is how the received count is completed.
The duration of a caliphate and the duration of stable political administration are not necessarily identical. A short reign can count in the recognized historical sequence.