ב אֵין מְבָרְכִין עַל הַיָּרֵחַ אֶלָּא בְּמוֹצָאֵי שַׁבָּת כְּשֶׁהוּא מְבֻשָּׂם וּבְגָדָיו נָאִים. הַגָּה: וְדַוְקָא אִם לֵיל מוֹצָאֵי שַׁבָּת הוּא קֹדֶם י' בַּחֹדֶשׁ, אָז מַמְתִּינִין עַד מוֹצָאֵי שַׁבָּת. אֲבָל אִם הוּא אַחַר כָּךְ, אֵין מַמְתִּינִין עַד מוֹצָאֵי שַׁבָּת שֶׁמָּא יִהְיוּ ב' לֵילוֹת אוֹ ג' אוֹ ד' עֲנָנִים וְלֹא יִרְאוּ הַלְּבָנָה וְיַעֲבֹר הַזְּמַן. וּכְשֶׁמְּקַדְּשִׁין אוֹתָהּ בַּחֹל יֵשׁ לִלְבֹּשׁ בְּגָדִים נָאִים, (ת"ה סִימָן ל"ה). אֵין מְקַדְּשִׁין הַלְּבָנָה קֹדֶם תִּשְׁעָה בְּאָב וְלֹא קֹדֶם יוֹם הַכִּפּוּרִים, (מַהֲרִי"ל). וּבְמוֹצָאֵי יוֹם הַכִּפּוּרִים מְקַדְּשִׁין אוֹתָהּ, דְּאָז שׁוֹרִין בְּשִׂמְחָה אֲבָל לֹא בְּמוֹצָאֵי תִּשְׁעָה בְּאָב אוֹ שְׁאָר תַּעֲנִית, (דִּבְרֵי עַצְמוֹ). וְאֵין מְקַדְּשִׁין אוֹתָהּ בְּמוֹצָאֵי שַׁבָּת שֶׁחָל בּוֹ יוֹם טוֹב. (מַהֲרִי"ל הִלְכוֹת יוֹם טוֹב). וִתוֹלֶה עֵינָיו וּמְיַשֵּׁר רַגְלָיו וּמְבָרֵךְ מְעֻמָּד (טוּר) וְאוֹמֵר שָׁלֹשׁ פְּעָמִים: סִימָן טוֹב תִּהְיֶה לְכָל יִשְׂרָאֵל בָּרוּךְ יוֹצְרֵךְ וְכו'. הַגָּה: וְרוֹקֵד ג' פְּעָמִים כְּנֶגְדָּהּ וְאוֹמֵר: כְּשֵׁם שֶׁאֲנִי רוֹקֵד כו' וְאוֹמֵר: תִּפֹּל עֲלֵיהֶם וְגו' וּלְמַפְרֵעַ: כָּאָבֶן יִדְמוּ כו' ג' פְּעָמִים, וְיֹאמַר לַחֲבֵרוֹ ג' פְּעָמִים: שָׁלוֹם עָלֶיךְ, (הג"ה הַחֲדָשׁוֹת) וּמֵשִׁיב הָוֵי כְּשׁוֹאֵל (טוּר). וְנוֹהֲגִין לוֹמַר: דָּוִד מֶלֶךְ יִשְׂרָאֵל חַי וְקַיָּם, שֶׁמַּלְכוּתוֹ נִמְשָׁל לַלְּבָנָה וְעָתִיד לְהִתְחַדֵּשׁ כְּמוֹתָהּ וּכְנֶסֶת יִשְׂרָאֵל תַּחֲזֹר לְהִתְדַּבֵּק בְּבַעֲלָהּ שֶׁהוּא הָקָּבָּ"ה, דֻּגְמַת הַלְּבָנָה הַמִּתְחֲדֶשֶׁת עִם הַחַמָּה שֶׁנֶּאֱמַר: שֶׁמֶשׁ וּמָגֵן ה' (תְּהִלִּים פד, יב) וּלְכָךְ עוֹשִׂין שְׂמָחוֹת וְרִקּוּדִין בְּקִדּוּשׁ הַחֹדֶשׁ דֻּגְמַת שִׂמְחַת נִשּׂוּאִין. (בְּחַיֵּי פָּרָשַׁת וַיֵּשֶׁב וְדִבְרֵי עַצְמוֹ).
2 We should only bless regarding the moon on motza'ei Shabbat, when one is perfumed and one's clothes are nice. Rema: and this is specifically when motza'ei Shabbat is before the 10th of the Hebrew month, in this case we wait until motza'ei Shabbat. However, if it's after this we don't wait to motza'ei Shabbat, lest there are 2 or 3 or 4 cloudy nights and the moon is invisible, and the time to bless passes. And when we bless the moon during the week, it's good to put on nice clothes (T"H chapter 35). We don't sanctify the moon before Tisha b'Av or before Yom haDin (Maharil), and when Yom Kippur goes out we bless it, since then we exist in a joyful state - but not when Tisha b'Av goes out, or any other fast (my own opinion), and we don't sanctify it on motza'ei Shabbat which falls on Yom Tov (Maharil, laws of Yom Tov). And one fixes their eyes and straightens their legs and blesses (Standing) (Tur) and says three times: "A good sign it will be for all of Israel, Blessed is your Creator etc." Rema: and dances three times towards it, and says "Just as I dance, etc", and says "Fear and terror will fall on them, etc" (Shemot 15:16), and again backwards, "Like a stone they will be, etc" three times, and says to one's friend three times "Peace be upon you" (Hagahot haChadashot), and responding to this greeting is like saying it (Tur). And we are accustomed to say "David, King of Israel, lives and exists", since his kingdom is compared to the moon and will in the future be renewed like it. And the assembly of Israel will return and cleave to her Husband, who is the Holy Blessed One, the image of the moon who is renewed with the moon - as it is said, "A sword and a shield is God" (Tehillim 84:12), and therefore we make joys and dance in the sanctification of the month, which is an image of the joy of a wedding. (Bachya, parshat vayeishev, and my own opinion).