שולחן ערוך, יורה דעה שצ״ו

Shulchan Arukh, Yoreh De'ah 396

דין אבל שלא נהג אבלותו כל שבעה. ובו ג' סעיפים:
אבל שלא נהג אבלותו תוך שבעה בין בשוגג בין במזיד משלים אותו כל שלשים חוץ מהקריעה שאם לא קרע בשעת חימום אינו קורע אלא תוך שבעה חוץ מאביו ואמו שקורע אפילו לאחר שבעה:
A mourner who did not observe his mourning rites during the seven [days of mourning], whether inadvertently or wilfully, may make up for it during the entire thirty [days of mourning] save for the rending of garments [concerning which the law is] that if he did not rend garments at the moment of excitement, he may rend only during the seven days [of mourning] save [in the case of] his father or mother [the law is] that he may rend even after the seven days [of mourning].
במה דברים אמורים בשלא נהג אבלות כלל כל שבעה אבל אם זלזל במקצת הימים ולא נהג בהם אבלות כגון מי שאמרו לו שמת לו מת ביום הא' והיה בעיר אחרת ולא נהג אבלות וביום השני בא לעירו ונהג אבלות אין צריך להשלים ומונה שבעה מיום הראשון:
This applies only if he did not observe mourning rites at all for the entire seven [days of mourning], but if he was neglectful in [the observance of] some days during which he did not observe mourning rites, e.g., one who was informed on the first day that he suffered a bereavement, and [at the time this was reported to him] he was in another town and did not observe mourning rites, and on the second day he arrived in his own town and observed mourning rites, — [the law is that] he is not required to complete [the days of mourning that he missed], but counts the seven days from the first day.
קטן שמת אביו ואמו ואפילו הגדיל תוך שבעה בטל ממנו כל דין אבלות ואינו חייב בו :
A minor whose father or/and mother died, even if he became of age within the seven [days of mourning], — the entire law of mourning lapses from him and he is not obligated therein.

Ashlei Ravrevei: Shulchan Aruch Yoreh Deah, Lemberg, 1888 (Public Domain) · Code of Hebrew Law by Chaim N. Denburg, Montreal, 1955 (CC-BY) · 3 se'ifim