ومن أوجب على نفسه اعتكاف أيام: لزمه اعتكافها بلياليها، وكانت متتابعة وإن لم يشترط التتابع فيها.
Translation: Whoever makes iʿtikāf for a number of days binding upon himself must observe those days with their nights, consecutively, even without expressly stipulating continuity.
Awjaba ʿalā nafsihi means making an obligation binding upon oneself, typically by a vow. A vow to retreat for named days includes the associated nights.
This is a rule about binding vows, not about a person merely intending to spend a few voluntary minutes in a mosque.