סימן ריט סעיף ז
אַף עַל פִּי שֶׁאֵין אֲבֵלוּת בְּיוֹם טוֹב וּבְחֹל הַמּוֹעֵד, וַאֲפִלּוּ גְזֵרַת שְׁלֹשִׁים אֵין בָּהֶם, וּמֻתָּר לוֹ לִלְבּוֹשׁ בְּגָדִים מְגֹהָצִים, מִכָּל מָקוֹם כֵּיוָן דְאָסוּר בָּהֶם בְּגִלּוּחַ מֵחֲמַת הַמּוֹעֵד (כְּדִלְעֵיל סִימָן קד סָעִיף יא), לָכֵן עוֹלִין לְמִנְיַן שְׁלֹשִׁים, וּמוֹנֶה שְׁלֹשִׁים מִיּוֹם הַקְּבוּרָה. וְיוֹם שְׁמִינִי עֲצֶרֶת, אַף עַל פִּי שֶׁהוּא רֶגֶל בִּפְנֵי עַצְמוֹ, מִכָּל מָקוֹם כֵּיוָן שֶׁלֹּא הִתְחִיל עֲדַיִן בַּאֲבֵלוּת, אֵינוֹ מְבַטֵּל, וְגַם בְמִנְיַן הַשְׁלֹשִׁים אֵינוֹ נִמְנֶה רַק לְיוֹם אֶחָד.
Although the laws of mourning do not apply on Yom Tov and Chol Hamoed, and even the laws of the thirty days of mourning do not apply, and he is permitted to wear pressed garments; nevertheless, since he is forbidden to have his hair cut because of the Yom Tov, the days of the Yom Tov are included in the thirty days and the thirty days are counted from the day the burial took place. Although Shemini Atzeress is a Yom Tov by itself, nevertheless, since he has not yet begun mourning, it does not cancel the period of mourning and in the total of thirty days, it counts as only one day.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)