From: Rabbi Moshe Sofer
To: Rabbi Yaakov Moshe Goldberg
An infant died on the thirty-first calendar day but before the exact hour of its birth. The Chasam Sofer upholds the ruling that mourning is required, demonstrating that hour-counting (me'es le'es) has never been applied to days, only to years, and that the thirty-day viability rule derives from shechitah and yibum laws which themselves do not count hours. The principle of leniency in mourning (halacha kedivrei hameikel ba'avel) is inapplicable here for multiple structural reasons.
Source: Shu"t Chasam Sofer YD §343