זמנים
הלכות שביתת יום טוב
פרק ו

Halacha

הלכה א
יוֹם טוֹב שֶׁחָל לִהְיוֹת עֶרֶב שַׁבָּת אֵין אוֹפִין וּמְבַשְּׁלִין בְּיוֹם טוֹב מַה שֶּׁהוּא אוֹכֵל לְמָחָר בְּשַׁבָּת. וְאִסּוּר זֶה מִדִּבְרֵי סוֹפְרִים כְּדֵי שֶׁלֹּא יָבֹא לְבַשֵּׁל מִיּוֹם טוֹב לְחל. שֶׁקַּל וָחֹמֶר הוּא לְשַׁבָּת אֵינוֹ מְבַשֵּׁל כָּל שֶׁכֵּן לְחל. לְפִיכָךְ אִם עָשָׂה תַּבְשִׁיל מֵעֶרֶב יוֹם טוֹב שֶׁיִּהְיֶה סוֹמֵךְ עָלָיו וּמְבַשֵּׁל וְאוֹפֶה בְּיוֹם טוֹב לְשַׁבָּת הֲרֵי זֶה מֻתָּר. וְתַבְשִׁיל שֶׁסּוֹמֵךְ עָלָיו הוּא הַנִּקְרָא עֵרוּבֵי תַּבְשִׁילִין:
כסף משנה
1.
When a holiday falls on Friday, on the holiday that precedes the Sabbath we may not bake or cook the food that will be eaten on the Sabbath. This prohibition is Rabbinic in origin,1The Beit Yosef (Orach Chayim 527) explains that the Rambam understands that scriptural law permits preparing for the Sabbath on a holiday. As support, he cites Pesachim 46b, which makes an explicit statement to that effect.
Tosafot (Pesachim, loc. cit.) differs and offers an alternative interpretation of that passage, and states that scriptural law forbids preparing for the Sabbath on a holiday. Nevertheless, this prohibition applies only when there is no time to benefit from this food on the holiday itself.
The Magen Avraham 527:1 states that the Rambam also accepts the latter position. [One might reach such a conclusion from the Rambam's statements in his Commentary on the Mishnah (Beitzah 1:1).] Most of the later authorities, however, agree with the Beit Yosef's interpretation of the Rambam's view. (See Be'ur Halachah 527.)
so that one will not prepare food on a holiday for a subsequent weekday.2The Rambam's ruling follows the opinion of Rav Ashi (Beitzah 15b). That passage also mentions the view of Ravva, who maintains that the requirement for an eruv was instituted as a measure of respect for the Sabbath, to ensure that one remembers to leave a fine portion of food for the Sabbath. (See Shulchan Aruch HaRav 527:2.) For a person will make the deduction: Since he is not [allowed to] cook for the Sabbath [on a holiday], surely, [he may not cook] for a weekday.
Therefore, a person who prepares a portion of food on the day prior to the holiday, and he relies on it, is permitted to cook and bake for the Sabbath on the holiday. The portion of food on which he relies is referred to as an eruv tavshilin.

הלכה ב
וְלָמָּה נִקְרָא שְׁמוֹ עֵרוּב. שֶׁכְּשֵׁם שֶׁהָעֵרוּב שֶׁעוֹשִׂין בַּחֲצֵרוֹת וּמְבוֹאוֹת מֵעֶרֶב שַׁבָּת מִשּׁוּם הֶכֵּר כְּדֵי שֶׁלֹּא יַעֲלֶה עַל דַּעְתָּם שֶׁמֻּתָּר לְהוֹצִיא מֵרְשׁוּת לִרְשׁוּת בְּשַׁבָּת. כָּךְ זֶה הַתַּבְשִׁיל מִשּׁוּם הֶכֵּר וְזִכָּרוֹן כְּדֵי שֶׁלֹּא יְדַמּוּ וְיַחְשְׁבוּ שֶׁמֻּתָּר לֶאֱפוֹת בְּיוֹם טוֹב מַה שֶּׁאֵינוֹ נֶאֱכָל בּוֹ בַּיּוֹם. וּלְפִיכָךְ נִקְרָא תַּבְשִׁיל זֶה עֵרוּבֵי תַּבְשִׁילִין:
כסף משנה
2.
Why is this called an eruv? [Because it creates a distinction.] The eruv3I.e., an eruv chatzerot, as described in the first five chapters of Hilchot Eruvin. that is established in courtyards and lanes on the day before the Sabbath is intended to create a distinction - so that people will not think that it is permitted to transfer articles from one domain to another on the Sabbath.
Similarly, this portion of food creates a distinction and a reminder, so that people do not think that it is permitted to bake food on a holiday that will not be eaten on that day. Therefore, the portion of food is referred to as an eruv tavshilin.4The Ra'avad rejects the rationale offered by the Rambam and gives another explanation: Eruv means "mixture," and this portion of food enables the combining together of the activities necessary to prepare for the Sabbath and for the holiday.
The Maggid Mishneh clarifies the Rambam's view, stating that the name eruv is appropriate only for an eruv chatzerot. Nevertheless, since both an eruv t'chumim and an eruv tavshilin involve a distinction that is created through depositing a portion of food, the Rabbis applied this term to those halachic institutions.

הלכה ג
עֵרוּבֵי תַּבְשִׁילִין שִׁעוּרוֹ אֵין פָּחוֹת מִכְּזַיִת בֵּין לְאֶחָד בֵּין לַאֲלָפִים. וְאֵין עוֹשִׂין עֵרוּב זֶה לֹא בְּפַת וְלֹא בְּרִיפוֱֹת וְכַיּוֹצֵא בָּהֶן אֶלָּא בְּתַבְשִׁיל שֶׁהוּא פַּרְפֶּרֶת כְּגוֹן בָּשָׂר וְדָגִים וּבֵיצִים וְכַיּוֹצֵא בָּהֶן. וַאֲפִלּוּ עֲדָשִׁים שֶׁבְּשׁוּלֵי קְדֵרָה וַאֲפִלּוּ שַׁמְנוּנִית שֶׁעַל גַּבֵּי הַסַּכִּין שֶׁחוֹתְכִין בָּהּ הַצָּלִי גּוֹרְדוֹ אִם יֵשׁ בּוֹ כְּזַיִת סוֹמֵךְ עָלָיו מִשּׁוּם עֵרוּבֵי תַּבְשִׁילִין:
כסף משנה
3.
The [minimum] measure of an eruv tavshilin is a portion of food the size of an olive. This suffices both for a single person and for a thousand.
This eruv may not be established with bread,5The Maggid Mishneh notes that according to the Rambam, it appears that it is not necessary to include bread in one's eruv at all. This view is shared by the Ramban and the Rashba. The Maggid Mishneh adds, however, that it is nevertheless customary to include bread in the eruv. Rabbenu Tam (Sefer HaYashar, section 392) and the Halachot Gedolot, by contrast, require that bread be included. (Their rationale is that since one desires both to cook and to bake on the festival for the Sabbath, the eruv should included both cooked food and bread which was baked.)
The Shulchan Aruch (Orach Chayim 527:2) states that at the outset, it is proper to include both bread and a portion of cooked food in the eruv. After the fact, however, the eruv is acceptable even if bread is not included. This ruling is accepted by the later authorities.
with cereal, or the like.6The Maggid Mishneh states that fruit is also excluded. This applies to fruit that is eaten raw. With regard to cooked fruit, the ruling depends on the local practice of whether or not it is customary to eat this together with meat. (Shulchan Aruch HaRav 527:11; Mishnah Berurah 527:18). Instead, a portion of cooked food that is served together with bread - e.g., meat, fish, eggs, and the like - must be used. [Nevertheless, one need not set aside a portion of choice food.7It is, however, customary to do so to fulfill the mitzvah behiddur, "in a manner that is becoming" (Mishnah Berurah 527:8).] Even lentils [left] at the bottom of the pot [are sufficient].8I.e., leftovers that one discovered when scraping the pot clean. Moreover, one may even rely on the fat that is left on the knife used to cut roast meat. If an amount the size of an olive is left when one scrapes it off, one may use it for an eruv tavshilin.9Shulchan Aruch HaRav 527:13 and the Mishnah Berurah 527:20 state that it is somewhat disrespectful to the mitzvah to use such foods, and this should be done only when one has no other food available.

הלכה ד
תַּבְשִׁיל שֶׁאָמְרוּ לְעִנְיַן עֵרוּב זֶה אֲפִלּוּ צָלִי אֲפִלּוּ שָׁלוּק אֲפִלּוּ כָּבוּשׁ אוֹ מְעֵשָּׁן אֲפִלּוּ דָּגִים קְטַנִּים שֶׁהֵדִיחָן בְּמַיִם חַמִּין וַהֲדָחָתָן הִיא בִּשּׁוּלָן לַאֲכִילָה הֲרֵי זֶה סוֹמֵךְ עֲלֵיהֶן:
כסף משנה
4.
With regard to such an eruv, the term "cooked food"10I.e., although at times the term "cooked" has a distinct meaning - "prepared in water over a fire" - and is used to the exclusion of these other forms of preparing food. also includes food that was roasted, stewed, pickled, or smoked. Even small fish that are prepared to be eaten by pouring hot water over them11See Hilchot Shabbat 9:3 and the Rambam's Commentary on the Mishnah (Machshirin 6:3). can be relied upon [for an eruv tavshilin].

הלכה ה
וְצָרִיךְ שֶׁיִּהְיֶה עֵרוּב זֶה מָצוּי עַד שֶׁיֹּאפֶה כָּל מַה שֶּׁהוּא צָרִיךְ לֶאֱפוֹת וּלְבַשֵּׁל כָּל שֶׁהוּא צָרִיךְ לְבַשֵּׁל. וְיָחֵם חַמִּין כָּל שֶׁהוּא צָרִיךְ. וְאִם נֶאֱכַל הָעֵרוּב אוֹ אָבַד אוֹ נִשְׂרַף קֹדֶם שֶׁיְּבַשֵּׁל אוֹ יֹאפֶה הֲרֵי זֶה אָסוּר לֶאֱפוֹת וּלְבַשֵּׁל אוֹ לְהָחֵם אֶלָּא מַה שֶּׁהוּא אוֹכֵל בְּיוֹם טוֹב בִּלְבַד. הִתְחִיל בְּעִסָּתוֹ אוֹ בְּתַבְשִׁילוֹ וְנֶאֱכַל הָעֵרוּב אוֹ אָבַד הֲרֵי זֶה גּוֹמֵר:
כסף משנה
5.
This eruv must be accessible until one has baked all that one must bake, cooked all that one must cook, and heated all the water one requires [for the Sabbath].12After one has completed all one's Sabbath preparations, one may eat the eruv before the commencement of the Sabbath (Shulchan Aruch, Orach Chayim 527:16). Nevertheless, it is customary to use the loaf of bread utilized for the eruv as lechem mishneh, the second loaf, for the Friday night meal and the Sabbath morning meal, and to partake of it during Se'udah Shelishit, the third Sabbath meal. The rationale: Since it was used for one mitzvah, it is proper to use it for others (Maharil, Shulchan Aruch HaRav 527:25; Mishnah Berurah 527:48). If the eruv is eaten, lost, or burned before one has cooked or baked [for the Sabbath], one may no longer bake, cook, or heat water, except what one requires for the holiday.13The Ra'avad notes that one can set aside the food one prepared for the holiday before the eruv was lost, and use that for the Sabbath, and prepare new food for the holiday. This is permitted even when one has completed all of one's preparations for the holiday. The Shulchan Aruch (loc. cit.:18) quotes this principle.
If one has already begun [kneading] a dough or [preparing] a portion of food, and the eruv is eaten or lost, one may complete the preparation [of this loaf or portion].14Our translation follows the understanding of the Rambam's statements as reflected in the Shulchan Aruch (loc. cit.:17). The Rishon LeTzion offers a different interpretation: that once one has started cooking or baking, one may continue preparation of the entire meal even if the eruv is lost. This view is not, however, accepted by the later authorities. (See also the Hagahot Maimoniot.) The authorities do, nevertheless, allow one to continue preparing an entire dish of food even when one had just begun the first stages of preparation before the eruv was lost.

הלכה ו
הַמֵּנִיחַ עֵרוּבֵי תַּבְשִׁילִין כְּדֵי שֶׁיִּסְמֹךְ עֲלֵיהֶם הוּא וַאֲחֵרִים צָרִיךְ לְזַכּוֹת לָהֶן כְּדֶרֶךְ שֶׁמְּזַכֶּה בְּעֵרוּבֵי שַׁבָּת. וְכָל שֶׁזּוֹכֶה בְּעֵרוּבֵי שַׁבָּת זוֹכֶה בְּעֵרוּבֵי תַּבְשִׁילִין. וְכָל שֶׁאֵינוֹ זוֹכֶה בְּאוֹתוֹ עֵרוּב אֵינוֹ זוֹכֶה בָּזֶה:
כסף משנה
6.
When a person sets aside an eruv tavshilin so that he and others may rely on it, he must grant others a portion as one grants them a portion with regard to the eruvin employed on the Sabbath.15See Hilchot Eruvin 1:20, 6:19-21.
Whoever is allowed to acquire a portion [on behalf of others] with regard to the eruvin of the Sabbath,16E.g., a person's wife, his adult sons and daughters, and his Jewish servants and maid-servants (ibid.). may acquire a portion [on their behalf] with regard to an eruv tavshilin. Conversely, whoever is not allowed to acquire a portion [for others] with regard to those eruvin17E.g., a person's children below the age of majority and his non-Jewish servants (ibid.). may not acquire a portion [for them] with regard to this [eruv].

הלכה ז
וְאֵינוֹ צָרִיךְ לְהוֹדִיעַ לְאֵלּוּ שֶׁזִּכָּה לָהֶן מֵעֶרֶב יוֹם טוֹב. אֲבָל הֵן צְרִיכִין לֵידַע שֶׁכְּבָר זִכָּה לָהֶן אַחֵר וְעֵרֵב לָהֶן וְאַחַר כָּךְ יִסְמְכוּ עָלָיו וִיבַשְּׁלוּ וְיֹאפוּ. אַף עַל פִּי שֶׁלֹּא יָדְעוּ אֶלָּא בְּיוֹם טוֹב הֲרֵי אֵלּוּ מֻתָּרִין. וְיֵשׁ לוֹ לְאָדָם לְעָרֵב עַל כָּל הָעִיר וְעַל כָּל הַקָּרוֹב אֵלֶיהָ בְּתוֹךְ הַתְּחוּם וּלְמָחָר מַכְרִיז וְאוֹמֵר כָּל מִי שֶׁלֹּא הִנִּיחַ עֵרוּבֵי תַּבְשִׁילִין יִסְמֹךְ עַל עֵרוּבִי:
כסף משנה
7.
It is not necessary to notify the others whom one grants a portion [in the eruv] before the commencement of the holiday.18The rationale is that having a portion in an eruv tavshilin is to a person's advantage, and a person may grant a colleague an advantage without his direct knowledge. However, they must know that someone has granted them a portion and established an eruv before they rely on it for cooking and baking. Even if they did not receive notification until the holiday itself, they are permitted [to rely on it].
A person may establish an eruv on behalf of all [the inhabitants of] a city,19Indeed, this is the custom reflected in the statement establishing an eruv tavshilin, which is included in all normal printed siddurim. That statement establishes an eruv for everyone in the entire city. It must, however, be emphasized that reciting the statement itself is not sufficient. As mentioned in the previous halachah, it is necessary to have another person acquire a share in the eruv on behalf of the others. and all those within its [holiday] limits.20The following rules apply when a person lives outside a city's holiday limits, but lives close enough to reach the city on a holiday if he establishes an eruv t'chumim: If the person making the eruv tavshilin made an explicit statement including the person living outside the city limits, he may rely on the eruv. Otherwise, he may not [Maggid Mishneh; Ramah (Orach Chayim 527:8)]. On the following day, he may announce, "Whoever did not establish an eruv tavshilin may rely on my eruv."21In this context, it is necessary to quote the ruling of the Shulchan Aruch (loc. cit.:7):

It is a mitzvah for every person to establish an eruv, and it is a mitzvah for the Torah leader of the community to establish an eruv on behalf of all the inhabitants of his community, so that a person who forgot to establish an eruv or was prevented from doing so, or who established an eruv that was later lost may rely upon it.
When, however, a person could establish an eruv, but fails to do so, because he desires to rely on the eruv established by the community's Torah leader, he is considered negligent, and may not rely on that eruv.

הלכה ח
הַמַּנִּיחַ עֵרוּבֵי תַּבְשִׁילִין חַיָּב לְבָרֵךְ. בָּרוּךְ אַתָּה ה' אֱלֹהֵינוּ מֶלֶךְ הָעוֹלָם אֲשֶׁר קִדְּשָׁנוּ בְּמִצְוֹתָיו וְצִוָּנוּ עַל מִצְוַת עֵרוּב. וְאוֹמֵר בְּעֵרוּב זֶה יֻתַּר לִי לֶאֱפוֹת וּלְבַשֵּׁל מִיּוֹם טוֹב שֶׁלְּמָחָר לְשַׁבָּת. וְאִם זָכָה בּוֹ לַאֲחֵרִים יֹאמַר לִי וְלִפְלוֹנִי וְלִפְלוֹנִי אוֹ לְאַנְשֵׁי הָעִיר כֻּלָּם לֶאֱפוֹת וּלְבַשֵּׁל מִיּוֹם טוֹב לְשַׁבָּת:
כסף משנה
8.
A person who establishes an eruv is required to recite [the following] blessing:22Although this commandment is Rabbinic in origin, it is proper to praise God, for He commanded us to follow the instructions of our Sages. (See Hilchot Eruvin 1:16; Hilchot Berachot 11:3.) "Blessed are You, God, our Lord, King of the Universe, who has sanctified us with His commandments and has commanded us concerning the mitzvah of eruv."
[At this time,] he should say: "With this eruv, I will be permitted to bake and to cook tomorrow23This applies in Eretz Yisrael, where the holidays are celebrated for one day only. In the diaspora, one omits the word "tomorrow" unless the holiday is celebrated on Friday and on the Sabbath. In that instance, one must establish an eruv on Thursday to be able to cook for the Sabbath on Friday, and the word "tomorrow" is in place. on the holiday24It is customary to add "...to put away a dish to preserve its heat, to kindle a flame, and to prepare and perform on the holiday everything necessary for the Sabbath." for the Sabbath." If he includes others in the eruv, he should say "...for me, and for so and so, and so and so...," or "for all the inhabitants of the city to bake and cook on the holiday for the Sabbath."

הלכה ט
מִי שֶׁלֹּא הִנִּיחַ עֵרוּבֵי תַּבְשִׁילִין וְלֹא הִנִּיחוּ לוֹ אֲחֵרִים. כְּשֵׁם שֶׁאָסוּר לוֹ לְבַשֵּׁל וְלֶאֱפוֹת כָּךְ קִמְחוֹ וּמַאֲכָלוֹ אָסוּר. וְאָסוּר לְאַחֵר שֶׁהִנִּיחַ לְעַצְמוֹ לְבַשֵּׁל וְלֶאֱפוֹת לָזֶה שֶׁלֹּא הִנִּיחַ עַד שֶׁיַּקְנֶה לוֹ שֶׁנִּמְצָא זֶה מְבַשֵּׁל וְאוֹפֶה שֶׁלּוֹ שֶׁהֲרֵי קָנָהוּ. וְאִם רָצָה יִתֵּן אַחַר כָּךְ לָזֶה שֶׁלֹּא הִנִּיחַ בְּמַתָּנָה:
כסף משנה
9.
When a person did not establish an eruv himself, and others did not include him in [their eruvin], just as he is forbidden to cook and bake, his flour and his food are forbidden [to be used on the holiday]. It is thus forbidden for another person who himself established [an eruv] to cook or to bake for the person who did not establish [an eruv, using provisions belonging to the person who did not establish an eruv], unless he transfers ownership25A formal transfer of ownership is required. The person acquiring the provisions must draw them into his own property or lift them up with the intent of acquiring them. It is not sufficient to acquire them by virtue of the transfer of a handkerchief (Shulchan Aruch HaRav 527:28; Mishnah Berurah 527:60). of his food [to the person who established an eruv].26The Tur [(Orach Chayim 527), based on Beitzah 21b] states that if there is no one who established an eruv to whom he could transfer ownership of his provisions, he is permitted to bake one loaf of bread, cook one type of food, and light one candle.
The Beit Yosef (Orach Chayim 527) explains that the Rambam does not accept this ruling. Nevertheless, the Beit Yosef continues, some authorities are even more lenient and extend this option even when there are people who have established eruvin upon whom one might rely.
In his Shulchan Aruch (Orach Chayim 527:20), Rav Yosef Karo quotes both views, but appears to favor that of the Rambam. Shulchan Aruch HaRav 527:29 and the Mishnah Berurah 527:61 cite the leniency mentioned by the Beit Yosef.

[If this transfer is made, such an arrangement is permitted, because the person who established an eruv] is cooking and baking [with] his own [provisions], for their ownership was transferred [to him]. If, afterwards, the person [who established an eruv] desires, he may give [this food] as a present to the person who did not establish [an eruv].

הלכה י
מִי שֶׁלֹּא הִנִּיחַ עֵרוּבֵי תַּבְשִׁילִין וּבִשֵּׁל וְאָפָה לֶאֱכל בַּיּוֹם וְהוֹתִיר אוֹ שֶׁזִּמֵּן אוֹרְחִים וְלֹא בָּאוּ הֲרֵי זֶה אוֹכֵל הַמּוֹתָר לְמָחָר. וְאִם הֶעֱרִים הֲרֵי זֶה אָסוּר לְאָכְלוֹ. עָבַר וְאָפָה וּבִשֵּׁל לְשַׁבָּת אֵין אוֹסְרִין עָלָיו. וְלָמָּה הֶחְמִירוּ וְאָסְרוּ עַל הַמַּעֲרִים וְלֹא אָסְרוּ עַל הַמֵּזִיד שֶׁאִם תַּתִּיר לַמַּעֲרִים נִמְצְאוּ הַכּל מַעֲרִימִין וְיִשְׁתַּקֵּעַ שֵׁם עֵרוּבֵי תַּבְשִׁילִין. אֲבָל הַמֵּזִיד אֵינוֹ מָצוּי וְאִם עָבַר הַיּוֹם לֹא יַעֲבֹר פַּעַם אַחֶרֶת:
כסף משנה
10.
When a person did not establish an eruv tavshilin and cooked and baked [food] to eat on [the holiday], and there was [food] left over, or he invited quests and they did not come, he may eat the remainder on the following day. If, however, he acted with guile27I.e., he cooked two types of food - one to be eaten on the holiday and one to be eaten on the Sabbath - or invited guests he knew would not come. It is permitted to cook a large quantity of food for the holiday and eat the remainder on the Sabbath (Shulchan Aruch, Orach Chayim 529:21). Moreover, there are opinions that one may cook several types of food, thus providing one with different food for the Sabbath as well, provided that one partakes of it on the holiday. Shulchan Aruch HaRav 527:27 and the Mishnah Berurah 527:68 state that the commonly accepted practice is to follow the latter leniency.[with regard to this matter], he is forbidden to partake [of this food].
If the person transgressed28Although the rationale given for this leniency applies primarily with regard to the willful transgression of the law, the Ramah (Orach Chayim 527:23) states that even when a person violated the prohibition unknowingly, and cooked food for the Sabbath on a holiday, he is permitted to partake of it. and cooked and baked [on the holiday] for the Sabbath without establishing an eruv tavshilin], it is not forbidden [for him to partake of it]. Why did [our Sages] judge a person with guile more severely than a person who willfully transgresses, [imposing] prohibitions [on the former and not on the latter]? Because if leniency were granted to a person who acts with guile, everyone would act with guile, and the entire concept of eruv tavshilin would be forgotten.29For others will emulate this undesirable example. To violate [Torah law] consciously, by contrast, is a rare phenomenon, and the fact that a person transgresses once does not mean that he will transgress in the future.

הלכה יא
שְׁנֵי יָמִים טוֹבִים שֶׁחָלוּ לִהְיוֹת בַּחֲמִישִׁי וְעֶרֶב שַׁבָּת עוֹשֶׂה עֵרוּבֵי תַּבְשִׁילִין מִיּוֹם רְבִיעִי שֶׁהוּא עֶרֶב יוֹם טוֹב. שָׁכַח וְלֹא הִנִּיחַ מַנִּיחוֹ בָּרִאשׁוֹן וּמַתְנֶה. כֵּיצַד. מַנִּיחַ עֵרוּבֵי תַּבְשִׁילִין בְּיוֹם חֲמִישִׁי וְאוֹמֵר אִם הַיּוֹם יוֹם טוֹב וּלְמָחָר חֹל לְמָחָר אֲבַשֵּׁל וְאוֹפֶה לְשַׁבָּת וְאֵינִי צָרִיךְ כְּלוּם וְאִם הַיּוֹם חֹל וּלְמָחָר יוֹם טוֹב בָּעֵרוּב זֶה יֵתַּר לִי לֶאֱפוֹת וּלְבַשֵּׁל לְמָחָר מִיּוֹם טוֹב לְשַׁבָּת:
כסף משנה
11.
When the two days of a holiday [celebrated in the diaspora] fall on Thursday and Friday, an eruv tavshilin should be established on Wednesday, the day before the holiday. If a person forgot and did not establish [an eruv before the holiday], he should deposit the eruv on the first day, and make a stipulation.30As explained in Halachah 14, this and the following halachah apply, because the celebration of the second day of the holiday was instituted as a result of the doubt regarding the day on which it should be celebrated. Therefore, one of the two days was in fact an ordinary weekday.
What is implied? He should deposit his eruv tavshilin on Thursday and say, "If today is a holiday, and tomorrow is a weekday, I will cook and bake for the Sabbath tomorrow, for there is no requirement. If today is a weekday, and tomorrow is a holiday, with this eruv I will be permitted to bake and to cook tomorrow, on the holiday, for the Sabbath."31See Hilchot Eruvin 8:14, which states that similar principles also apply with regard to an eruv chatzerot. An eruv t'chumim, by contrast, cannot be established in a conditional manner.

הלכה יב
כַּיּוֹצֵא בּוֹ הָיוּ לְפָנָיו שְׁתֵּי כַּלְכָּלוֹת שֶׁל טֶבֶל בְּיוֹם טוֹב רִאשׁוֹן אוֹמֵר אִם הַיּוֹם חֹל תִּהְיֶה זוֹ תְּרוּמָה עַל זוֹ וְאִם הַיּוֹם קֹדֶשׁ אֵין בִּדְבָרַי כְּלוּם. וְקוֹרֵא עָלֶיהָ שֵׁם וּמַנִּיחָהּ. וּלְמָחָר בַּשֵּׁנִי חוֹזֵר וְאוֹמֵר אִם הַיּוֹם קֹדֶשׁ אֵין בִּדְבָרַי כְּלוּם וְאִם הַיּוֹם חֹל תִּהְיֶה זוֹ תְּרוּמָה עַל זוֹ וְקוֹרֵא עָלֶיהָ שֵׁם וּמַנִּיחָהּ כְּדֶרֶךְ שֶׁקָּרָא עָלֶיהָ בָּרִאשׁוֹן. וּמַנִּיחַ אֶת זוֹ שֶׁקָּרָא עָלֶיהָ שֵׁם תְּרוּמָה וְאוֹכֵל אֶת הַשְּׁנִיָּה:
כסף משנה
12.
To cite a similar example: when a person possesses two baskets of produce from which terumah was not separated, on the first day of the holiday he should say,32For it is forbidden to separate terumah on a holiday, as stated above, Chapter 4, Halachah 26. "If today is a weekday, may this [basket] be considered terumah for [the other basket]. If today is a holiday, then may my words be of no consequence." He should then designate [the basket as terumah] and leave it.
On the second day [of the holiday], he should return and say, "If today is a holiday, then may my words be of no consequence. If today is a weekday, may this [basket] be considered terumah for [the other basket]." He should then designate [the same basket as terumah] and leave it as he did on the first day. [After] depositing the basket that he designated as terumah, he may partake of the other one.33For the separation of the terumah on either the first or the second day is thus valid.

הלכה יג
בַּמֶּה דְּבָרִים אֲמוּרִים בִּשְׁנֵי יָמִים טוֹבִים שֶׁל גָּלֻיּוֹת אֲבָל בִּשְׁנֵי יָמִים טוֹבִים שֶׁל רֹאשׁ הַשָּׁנָה אִם שָׁכַח וְלֹא הִנִּיחַ בְּיוֹם רְבִיעִי שׁוּב אֵינוֹ מַנִּיחַ אֶלָּא סוֹמֵךְ עַל אֲחֵרִים אִם עֵרְבוּ עָלָיו אוֹ מַקְנֶה קִמְחוֹ לְמִי שֶׁעֵרֵב אוֹ יִהְיֶה אָסוּר לֶאֱפוֹת וּלְבַשֵּׁל לְשַׁבָּת. וְכֵן אִם שָׁכַח וְלֹא הִפְרִישׁ תְּרוּמָה מִיּוֹם רְבִיעִי שׁוּב אֵינוֹ מַפְרִישׁ עַד מוֹצָאֵי שַׁבָּת:
כסף משנה
13.
When does the above apply? With regard to the two days observed as holidays in the diaspora. Concerning the two days observed as the holiday of Rosh HaShanah,34As explained in Chapter 1, Halachah 24, in contrast to the other holidays, the two days of Rosh HaShanah are considered a single continuum of holiness. They are given this status because Rosh HaShanah was always observed for two days, even in Eretz Yisrael itself. by contrast, a person who forgot and did not establish an eruv on Wednesday does not have another opportunity to establish [an eruv]. He should either rely on the eruv established by others on his behalf, transfer ownership of his flour to someone who established an eruv, or be forbidden to bake and cook for the Sabbath.
Similarly, a person who did not separate terumah on Wednesday may not separate it until Saturday night.

הלכה יד
כָּל הַדְּבָרִים הָאֵלּוּ שֶׁאָמַרְנוּ הָיוּ בִּזְמַן שֶׁהָיוּ בֵּית דִּין שֶׁל אֶרֶץ יִשְׂרָאֵל מְקַדְּשִׁין עַל פִּי הָרְאִיָּה וְהָיוּ בְּנֵי הַגָּלֻיּוֹת עוֹשִׂין שְׁנֵי יָמִים כְּדֵי לְהִסְתַּלֵּק מִן הַסָּפֵק לְפִי שֶׁלֹּא הָיוּ יוֹדְעִין יוֹם שֶׁקִּדְּשׁוּ בְּנֵי אֶרֶץ יִשְׂרָאֵל. אֲבָל הַיּוֹם שֶׁבְּנֵי אֶרֶץ יִשְׂרָאֵל סוֹמְכִין עַל הַחֶשְׁבּוֹן וּמְקַדְּשִׁין עָלָיו אֵין יוֹם טוֹב שֵׁנִי לְהִסְתַּלֵּק מִן הַסָּפֵק אֶלָּא מִנְהָג בִּלְבַד:
כסף משנה
14.
The above concepts applied only when the High Court of Eretz Yisrael would sanctify [the new moon] based on the observation [of witnesses],35See Hilchot Kiddush HaChodesh, Chapter 1. and the Jews in the diaspora would celebrate two days [as a holiday] to avoid the doubt, for they did not know the date on which the inhabitants of Eretz Yisrael sanctified [the new moon]. At present, however, the inhabitants of Eretz Yisrael follow a fixed calendar and sanctify [the months accordingly]. Therefore, the second day of a holiday is [observed], not to avoid a doubt, but [to perpetuate] a custom.36See Hilchot Kiddush HaChodesh 5:5.

הלכה טו
וּלְפִיכָךְ אֲנִי אוֹמֵר שֶׁאֵין מְעָרֵב אָדָם וּמַתְנֶה בַּזְּמַן הַזֶּה לֹא עֵרוּבֵי תַּבְשִׁילִין וְלֹא עֵרוּבֵי חֲצֵרוֹת וְלֹא שִׁתּוּפֵי מְבוֹאוֹת וְאֵינוֹ מְעַשֵּׂר הַטֶּבֶל עַל תְּנַאי אֶלָּא הַכּל מֵעֶרֶב יוֹם טוֹב בִּלְבַד:
כסף משנה
15.
I therefore maintain that a person may not establish on a conditional basis either an eruv tavshilin, an eruv chatzerot, or a shituf in a lane. Nor may he tithe untithed produce on a conditional basis.37The Rambam's logic is that in the era when the sanctification of the moon was dependent on the testimony of witnesses, the observance of the second day of a holiday was necessary because of the doubt regarding the Scriptural commandment (safek d'oraita). At present, there is no doubt; the second day is observed, because of a Rabbinical decree. Thus, one cannot say, "If today is a weekday," for neither of the days is a weekday: the first is a holiday according to Scriptural law, and the second is a holiday according to Rabbinic law.
The Ra'avad voices his appreciation of the Rambam's logic, but states that in practice, the custom has been to continue making conditional statements as was done in previous generations. The Shulchan Aruch (Orach Chayim 527:22) cites the Ra'avad's view. In his Beit Yosef (Orach Chayim 528) Rav Yosef Karo explains the more lenient view, stating that when instituting the observance of the second day of the holidays in the present era, our Sages did not require its observance to be more stringent than it was originally. Since such conditional statements were originally acceptable, they are also acceptable in the present era.
Instead, he must perform [all such activities] on the day prior to the holiday.

הלכה טז
כְּשֵׁם שֶׁמִּצְוָה לְכַבֵּד שַׁבָּת וּלְעַנְּגָהּ כָּךְ כָּל יָמִים טוֹבִים שֶׁנֶּאֱמַר (ישעיה נח יג) "לִקְדוֹשׁ ה' מְכֻבָּד" וְכָל יָמִים טוֹבִים נֶאֱמַר בָּהֶן (ויקרא כג ז) "מִקְרָא קֹדֶשׁ". וּכְבָר בֵּאַרְנוּ הַכִּבּוּד וְהָעִנּוּג בְּהִלְכוֹת שַׁבָּת. וְכֵן רָאוּי לְאָדָם שֶׁלֹּא יִסְעֹד בְּעַרְבֵי יָמִים טוֹבִים מִן הַמִּנְחָה וּלְמַעְלָה כְּעֶרֶב שַׁבָּת שֶׁדָּבָר זֶה בִּכְלַל הַכָּבוֹד. וְכָל הַמְבַזֶּה אֶת הַמּוֹעֲדוֹת כְּאִלּוּ נִטְפָּל לַעֲבוֹדַת כּוֹכָבִים:
כסף משנה
16.
Just as it is a mitzvah to honor the Sabbath and to take delight in it, so too, do [these obligations apply to] all the holidays,38The B'nei Binyamin notes that several later authorities differ with regard to whether a holiday could be termed a Sabbath or not. (See P'nei Yehoshua, et al., at the conclusion of the fourth chapter of Beitzah.) Nevertheless, the Rambam's emphasis is not that the holidays are "Sabbaths," but that they are sanctified. as [implied by Isaiah 58:13], "...sanctified unto God and honored."39Although the proof-text states, "And you shall call the Sabbath 'A delight, sanctified unto God'...," it also applies to holidays, for they are also called "sanctified" by the Torah. [This applies to] all the holidays, for they are called, "holy convocations." We have explained the obligation implied by honor and delight in Hilchot Shabbat.40Chapter 30. Honor involves preparing one's home and one's garments for the Sabbath. Delight involves partaking of fine foods, and carrying out other activities that lead to physical satisfaction.
Similarly, it is proper for a person not to partake of a [significant] meal on the day before a holiday from mid-afternoon onward, as on Friday.41See Hilchot Shabbat 30:4, which explains that this restriction was instituted so that one will enter the Sabbath (in this instance, the holiday) with an appetite.
Mid-afternoon refers to nine seasonal hours after daybreak - i.e., 3 PM, on a day that begins at 6 AM and ends at 6 PM. This time will change throughout the year, becoming later in the summer and earlier in the winter.
For this is also an expression of honor.
Everyone who treats the holidays with disrespect is considered as if he became associated with idol worship.42Pesachim 118a notes that Exodus 34:17 states, "Do not make molten images for yourselves," and continues "observe the festival of matzot," establishing a connection between the two mitzvot.
Significantly, the Rashbam interprets this as referring to someone who works on the intermediate days of a festival. (See also Hilchot Teshuvah 3:14, which states that such a person is not granted a portion in the World-to-Come.)

הלכה יז
שִׁבְעַת יְמֵי הַפֶּסַח וּשְׁמוֹנַת יְמֵי הֶחָג עִם שְׁאָר יָמִים טוֹבִים כֻּלָּם אֲסוּרִים בְּהֶסְפֵּד וְתַעֲנִית. וְחַיָּב אָדָם לִהְיוֹת בָּהֶן שָׂמֵחַ וְטוֹב לֵב הוּא וּבָנָיו וְאִשְׁתּוֹ וּבְנֵי בֵּיתוֹ וְכָל הַנִּלְוִים עָלָיו שֶׁנֶּאֱמַר (דברים טז יד) "וְשָׂמַחְתָּ בְּחַגֶּךָ" וְגוֹ'. אַף עַל פִּי שֶׁהַשִּׂמְחָה הָאֲמוּרָה כָּאן הִיא קָרְבַּן שְׁלָמִים כְּמוֹ שֶׁאָנוּ מְבָאֲרִין בְּהִלְכוֹת חֲגִיגָה יֵשׁ בִּכְלַל אוֹתָהּ שִׂמְחָה לִשְׂמֹחַ הוּא וּבָנָיו וּבְנֵי בֵּיתוֹ כָּל אֶחָד כָּרָאוּי לוֹ:
כסף משנה
17.
It is forbidden to fast or recite eulogies43For these activities run contrary to the spirit of rejoicing that must be encouraged on the festivals. The laws of mourning on the festivals are discussed in Hilchot Eivel, Chapter 10. on the seven days of Pesach, the eight days of Sukkot, and the other holidays.44With this wording, the Rambam emphasizes that this prohibition also applies on the days of Chol HaMo'ed of Pesach and Sukkot. The other holidays the Rambam refers to are Rosh HaShanah and Shavuot.
The designation of Rosh HaShanah as a day of rejoicing - despite the fact that it is "the day of judgment" when we join in the collective acceptance of God as King - is reflected in Nechemiah 8:10, which records the charge Ezra and Nechemiah gave to the people: "Eat sumptuously, drink sweet beverages, and send portions to those who have none... for the joy of God is your strength" (based on a responsum of the Rambam's grandson, Rav Yehoshua HaNagid).
On these days, a person is obligated to be happy and in good spirits; he, his children, his wife, the members of his household, and all those who depend on him, as [Deuteronomy 16:14] states: "And you shall rejoice in your festivals."
The "rejoicing" mentioned in the verse refers to sacrificing peace offerings, as will be explained in Hilchot Chaggigah.45Hilchot Chaggigah 1:1 explains that in addition to the peace offerings referred to as korban chaggigah, other peace offerings should be sacrificed, so that one will partake of sacrificial meat during the holiday. These are referred to as shalmei simchah (peace offerings of joy) and the Rambam associates partaking of them with the mitzvah to "rejoice on your festivals." Nevertheless, included in [this charge to] rejoice is that he, his children, and the members of his household should rejoice, each one in a manner appropriate for him.

הלכה יח
כֵּיצַד. הַקְּטַנִּים נוֹתֵן לָהֶם קְלָיוֹת וֶאֱגוֹזִים וּמִגְדָּנוֹת. וְהַנָּשִׁים קוֹנֶה לָהֶן בְּגָדִים וְתַכְשִׁיטִין נָאִים כְּפִי מָמוֹנוֹ. וְהָאֲנָשִׁים אוֹכְלִין בָּשָׂר וְשׁוֹתִין יַיִן שֶׁאֵין שִׂמְחָה אֶלָּא בְּבָשָׂר וְאֵין שִׂמְחָה אֶלָּא בְּיַיִן. וּכְשֶׁהוּא אוֹכֵל וְשׁוֹתֶה חַיָּב לְהַאֲכִיל לַגֵּר לַיָּתוֹם וְלָאַלְמָנָה עִם שְׁאָר הָעֲנִיִּים הָאֻמְלָלִים. אֲבָל מִי שֶׁנּוֹעֵל דַּלְתוֹת חֲצֵרוֹ וְאוֹכֵל וְשׁוֹתֶה הוּא וּבָנָיו וְאִשְׁתּוֹ וְאֵינוֹ מַאֲכִיל וּמַשְׁקֶה לַעֲנִיִּים וּלְמָרֵי נֶפֶשׁ אֵין זוֹ שִׂמְחַת מִצְוָה אֶלָּא שִׂמְחַת כְּרֵסוֹ. וְעַל אֵלּוּ נֶאֱמַר (הושע ט ד) "זִבְחֵיהֶם כְּלֶחֶם אוֹנִים לָהֶם כָּל אֹכְלָיו יִטַּמָּאוּ כִּי לַחְמָם לְנַפְשָׁם". וְשִׂמְחָה כָּזוֹ קָלוֹן הִיא לָהֶם שֶׁנֶּאֱמַר (מלאכי ב ג) "וְזֵרִיתִי פֶרֶשׁ עַל פְּנֵיכֶם פֶּרֶשׁ חַגֵּיכֶם":
כסף משנה
18.
What is implied?46I.e., what are the activities that will arouse happiness? Cognizant that an emotion cannot be commanded at will, our Sages required that on the holidays a person work on creating a setting that will naturally spur happiness to ensue. Children should be given roasted seeds, nuts, and sweets. For women, one should buy attractive clothes and jewelry according to one's financial capacity. Men should eat meat and drink wine, for there is no happiness without partaking of meat,47The commentaries have raised questions on the Rambam's statements, based on Pesachim 109a, which states that during the time of the Temple, "there is no happiness without partaking of meat," this referring to sacrificial meat, as Deuteronomy 27:7 states, "And you shall sacrifice peace offerings... and you shall rejoice." After the destruction of the Temple, "there is no happiness without partaking of wine." No mention is made of the importance of eating non-sacrificial meat on the holidays.
Shulchan Aruch HaRav 529:7 explains that at present there is a greater obligation to drink wine than to eat meat. Nevertheless, since most people derive pleasure from eating meat, it is proper to partake of meat on the holidays.
nor is there happiness without partaking of wine.48The intent is not that one's festive pleasure should be eating and drinking, as indicated by the following halachot. Instead, the intent is that a person should create an atmosphere of rest, relaxation, and happiness so that he can direct his attention to spiritual matters.
When a person eats and drinks [in celebration of a holiday], he is obligated to feed converts, orphans, widows,49When relating the command to rejoice on the festivals, Deuteronomy 16:14 states, "You shall rejoice on your festival together with your son and your daughter, your male and your female servants, the Levite, the convert, the orphan, and the widow." The Torah thus links the happiness one shares with the members of one's household with one's generosity in inviting the unfortunate to join in this rejoicing.
See also Hilchot Megillah 2:17, which states:

There is no greater and more splendid happiness than to gladden the hearts of the poor, the orphans, the widows, and the converts.
One who brings happiness to the hearts of these unfortunates resembles the Divine Presence, which [Isaiah 57:15] describes [as having the tendency] "to revive the spirit of the lowly and... those with broken hearts."
and others who are destitute and poor.50The Mishnah Berurah 529:17 mentions that in addition to inviting guests to one's festive table, a collection should also be made before the holiday to provide for the holiday needs of poor people who are too embarrassed to ask for hospitality. In contrast, a person who locks the gates of his courtyard and eats and drinks with his children and his wife, without feeding the poor and the embittered, is [not indulging in] rejoicing associated with a mitzvah, but rather the rejoicing of his gut.
And with regard to such a person [the verse, Hoshea 9:4] is applied: "Their sacrifices will be like the bread of mourners, all that partake thereof shall become impure, for they [kept] their bread for themselves alone." This happiness is a disgrace for them, as [implied by Malachi 2:3]: "I will spread dung on your faces, the dung of your festival celebrations."

הלכה יט
אַף עַל פִּי שֶׁאֲכִילָה וּשְׁתִיָּה בַּמּוֹעֲדוֹת בִּכְלַל מִצְוַת עֲשֵׂה. לֹא יִהְיֶה אוֹכֵל וְשׁוֹתֶה כָּל הַיּוֹם כֻּלּוֹ. אֶלָּא כָּךְ הִיא הַדָּת. בַּבֹּקֶר מַשְׁכִּימִין כָּל הָעָם לְבָתֵּי כְּנֵסִיּוֹת וּלְבָתֵּי מִדְרָשׁוֹת וּמִתְפַּלְּלִין וְקוֹרִין בַּתּוֹרָה בְּעִנְיַן הַיּוֹם וְחוֹזְרִין לְבָתֵּיהֶם וְאוֹכְלִין. וְהוֹלְכִין לְבָתֵּי מִדְרָשׁוֹת קוֹרִין וְשׁוֹנִין עַד חֲצִי הַיּוֹם. וְאַחַר חֲצוֹת הַיּוֹם מִתְפַּלְּלִין תְּפִלַּת הַמִּנְחָה וְחוֹזְרִין לְבָתֵּיהֶן לֶאֱכל וְלִשְׁתּוֹת שְׁאָר הַיּוֹם עַד הַלַּיְלָה:
כסף משנה
19.
Although eating and drinking on the holidays are included in the positive commandment [to rejoice], one should not devote the entire day to food and drink. The following is the desired practice:
In the morning, the entire people should get up and attend the synagogues and the houses of study where they pray and read a portion of the Torah pertaining to the holiday.51See Hilchot Tefillah, Chapter 13, where the Torah portions associated with each holiday are mentioned. Afterwards, they should return home and eat. Then they should go to the house of study, where they read [from the Written Law] and review [the Oral Law] until noon.
After noon, they should recite the afternoon service and return home to eat and drink for the remainder of the day until nightfall.52The Rambam's statements follow the general guidelines given by Beitzah 15b, which states: Deuteronomy 16:18 refers to the festivals as "a gathering for God, your Lord," while Numbers 29:35 uses the expression, "A gathering for yourselves." What should be done? Divide them, half to God, and half to yourselves.

הלכה כ
כְּשֶׁאָדָם אוֹכֵל וְשׁוֹתֶה וְשָׂמֵחַ בָּרֶגֶל לֹא יִמָּשֵׁךְ בְּיַיִן וּבִשְׂחוֹק וְקַלּוּת רֹאשׁ וְיֹאמַר שֶׁכָּל מִי שֶׁיּוֹסִיף בָּזֶה יַרְבֶּה בְּמִצְוַת שִׂמְחָה. שֶׁהַשִּׁכְרוּת וְהַשְּׂחוֹק הָרַבָּה וְקַלּוּת הָרֹאשׁ אֵינָהּ שִׂמְחָה אֶלָּא הוֹלְלוּת וְסִכְלוּת וְלֹא נִצְטַוֵּינוּ עַל הַהוֹלְלוּת וְהַסִּכְלוּת אֶלָּא עַל הַשִּׂמְחָה שֶׁיֵּשׁ בָּהּ עֲבוֹדַת יוֹצֵר הַכּל שֶׁנֶּאֱמַר (דברים כח מז) "תַּחַת אֲשֶׁר לֹא עָבַדְתָּ אֶת ה' אֱלֹהֶיךָ בְּשִׂמְחָה וּבְטוּב לֵבָב מֵרֹב כּל". הָא לָמַדְתָּ שֶׁהָעֲבוֹדָה בְּשִׂמְחָה. וְאִי אֶפְשָׁר לַעֲבֹד אֶת הַשֵּׁם לֹא מִתּוֹךְ שְׂחוֹק וְלֹא מִתּוֹךְ קַלּוּת רֹאשׁ וְלֹא מִתּוֹךְ שִׁכְרוּת:
כסף משנה
20.
When a person eats, drinks, and celebrates on a festival, he should not let himself become overly drawn to drinking wine, mirth, and levity, saying, "whoever indulges in these activities more is increasing [his observance of] the mitzvah of rejoicing." For drunkenness,53With regard to drunkenness, note the Rambam's statements in Hilchot De'ot 5:2, and in the Guide for the Perplexed, Vol. III, chapter 8. profuse mirth, and levity are not rejoicing; they are frivolity and foolishness.
And we were not commanded to indulge in frivolity or foolishness, but rather in rejoicing that involves the service of the Creator of all existence. Thus, [Deuteronomy 28:47] states, "Because you did not serve God, Your Lord, with happiness and a glad heart with an abundance of prosperity." This teaches us that service [of God] involves joy. And it is impossible to serve God while in the midst of levity, frivolity, or drunkenness.54There are two dimensions reflected by the Rambam's statements:
a) the absolute negation of the hollow elation of frivolity;
b) the appreciation of the positive value of genuine happiness as an element of the service of God.
The latter concept receives greater focus in the conclusion of Hilchot Lulav, where the Rambam states:

The happiness with which a person should rejoice in the fulfillment of the mitzvot and the love of God who commanded them is a great service.... There is no greatness or honor other than celebrating before God.

הלכה כא
חַיָּבִין בֵּית דִּין לְהַעֲמִיד שׁוֹטְרִים בָּרְגָלִים שֶׁיִּהְיוּ מְסַבְּבִין וּמְחַפְּשִׂין בַּגַּנּוֹת וּבַפַּרְדֵּסִים וְעַל הַנְּהָרוֹת כְּדֵי שֶׁלֹּא יִתְקַבְּצוּ לֶאֱכל וְלִשְׁתּוֹת שָׁם אֲנָשִׁים וְנָשִׁים וְיָבוֹאוּ לִידֵי עֲבֵרָה. וְכֵן יַזְהִירוּ בְּדָבָר זֶה לְכָל הָעָם כְּדֵי שֶׁלֹּא יִתְעָרְבוּ אֲנָשִׁים וְנָשִׁים בְּבָתֵּיהֶם לְשִׂמְחָה. וְלֹא יִמָּשְׁכוּ בַּיַּיִן שֶׁמָּא יָבוֹאוּ לִידֵי עֲבֵרָה:
כסף משנה
21.
The [Jewish] court is obligated to appoint officers who will circulate [among the people] on the festivals and check the gardens, orchards, and river banks to see that men and women do not gather there to eat or to drink, lest they [conduct themselves immodestly and come to] sin.
Similarly, they must warn the people that men and women should not mix at festive gatherings in homes, nor should they overindulge in wine, lest they be led to sin.

הלכה כב
יָמִים שֶׁבֵּין רִאשׁוֹן וּשְׁבִיעִי שֶׁל פֶּסַח וְרִאשׁוֹן וּשְׁמִינִי שֶׁל חַג הַסֻּכּוֹת וְהֵן בַּגּוֹלָה אַרְבָּעָה בְּתוֹךְ הַפֶּסַח וַחֲמִשָּׁה בְּתוֹךְ הֶחָג הֵם הַנִּקְרָאִין חֻלּוֹ שֶׁל מוֹעֵד וְנִקְרָאִין מוֹעֵד. וְאַף עַל פִּי שֶׁהֵם חַיָּבִין בְּשִׂמְחָה וַאֲסוּרִין בְּהֶסְפֵּד וְתַעֲנִית מֻתָּר לִסְפֹּד בָּהֶן תַּלְמִיד חָכָם בְּפָנָיו. אֲבָל לְאַחַר שֶׁיִּקָּבֵר אָסוּר לְסָפְדוֹ בָּהֶן. וְאֵין צָרִיךְ לוֹמַר בְּרָאשֵׁי חֳדָשִׁים בַּחֲנֻכָּה וּבְפוּרִים שֶׁסּוֹפְדִין בָּהֶן תַּלְמִידֵי חֲכָמִים בְּפָנָיו אַף עַל פִּי שֶׁיָּמִים אֵלּוּ אֲסוּרִין בְּהֶסְפֵּד וְתַעֲנִית. אֲבָל לְאַחַר הַקְּבוּרָה אָסוּר לִסְפֹּד בָּהֶן:
כסף משנה
22.
The days between the first and the seventh days of Pesach and [the days between] the first and the eighth days of Sukkot are called Chol HaMo'ed55Chol means "ordinary" or "weekday" in Hebrew and HaMo'ed means "the festival." Thus, the term means "the ordinary days of the festival." For the Torah tells us that the festivals of Pesach and Sukkot should be celebrated for seven and eight days respectively, but states that only the first and last days should be regarded as holidays. The observance of these "ordinary days of the festival" is the focus of the remainder of the text. and are also called mo'ed. In the diaspora,56Where the first day of each holiday is celebrated for an extra day. there are four days during Pesach and five days during Sukkot.
Although we are obligated to celebrate on these days, and it is forbidden to deliver a eulogy or to fast,57See Hilchot Ta'aniot 1:7. it is permitted to deliver a eulogy before the corpse of a Torah sage. After he is buried, however, it is forbidden to deliver a eulogy on these days.58See Hilchot Eivel 11:5. The Ra'avad adds that a eulogy may be recited on the day when a community hears about a sage's death. The Rambam mentions this concept in Hilchot Eivel.
Needless to say that on Rosh Chodesh, on Chanukah, and on Purim we may deliver a eulogy before the corpse of a Torah sage, although it is forbidden to fast or deliver a eulogy on these days.59See Hilchot Megillah 2:13; Hilchot Chanukah 3:3. After the burial, however, it is forbidden to deliver a eulogy on these days.

הלכה כג
אֵין מַנִּיחִין מִטַּת הַמֵּת בָּרְחוֹב בַּמּוֹעֵד שֶׁלֹּא לְהַרְגִּיל אֶת הַהֶסְפֵּד אֶלָּא מִבֵּיתוֹ לְקִבְרוֹ. וְאֵין מִתְאַבְּלִין בַּמּוֹעֵד. וְכֵן אֵין קוֹרְעִין וְלֹא מַבְרִין וְלֹא חוֹלְצִין הַכָּתֵף בַּמּוֹעֵד עַל הַמֵּת אֶלָּא קְרוֹבָיו שֶׁהֵן חַיָּבִין לְהִתְאַבֵּל עָלָיו. וְאִם הָיָה חָכָם אוֹ אָדָם כָּשֵׁר אוֹ שֶׁהָיָה עוֹמֵד עָלָיו בִּשְׁעַת נְטִילַת נְשָׁמָה הֲרֵי זֶה קוֹרֵעַ עָלָיו בַּמּוֹעֵד אַף עַל פִּי שֶׁאֵינוֹ קְרוֹבוֹ. וְאֵין קוֹרְעִין בְּיוֹם טוֹב שֵׁנִי כְּלָל וַאֲפִלּוּ קְרוֹבָיו שֶׁל מֵת:
כסף משנה
23.
The bier of a corpse should not be left in the street during [Chol Ha]Mo'ed, so that [no one] will be prompted to deliver a eulogy. Instead, it should be taken from the home to the grave.60The mitzvah of l'vayah, accompanying the deceased, is carried out on Chol HaMo'ed. What is not done is to remain in a single place for a prolonged time.
We do not observe the rites of mourning during [Chol Ha]Mo'ed.61Mo'ed Katan 14b states that since the mitzvah of celebrating on the festivals is incumbent on the entire Jewish community as a whole, it takes precedence over the obligation of individuals to mourn. Nor does one rend his garments, partake of the meal of solace [served after the burial],62Even the relatives who partake of this meal should sit on ordinary chairs (Mo'ed Katan 3:7). or bare his shoulder because of a deceased during [Chol Ha]Mo'ed,63The Shulchan Aruch (Yoreh De'ah 340:16) states that one may bare one's shoulders in honor of any deceased person, and one must do so in honor of one's parents. At present, however, this custom is not followed at all even during an ordinary week (Ramah, loc. cit.:17). with the exception of the relatives who are obligated to mourn because of him.64I.e., the deceased's parents, spouse, brothers and sisters (this includes half-brothers and half-sisters), and children.
If the deceased was a sage or an upright man,65The Ramah (Yoreh De'ah 340:6) differs and states that at present it is not customary to rend one's garments because of a person's death unless one was present at the actual moment of death. This applies throughout the year as well as during Chol Hamoed. or one was present at his death,66This applies even if the deceased's conduct was unworthy (Shulchan Aruch, Yoreh De'ah 340:5). The Ramah adds that if the person was wont to commit any particular sin, there is no need to rend one's garments because of him. one should rend one's clothes because of his [death] during [Chol Ha]Mo'ed even though one is not related [to the deceased]. We may not rend our garments on the second day of a holiday at all;67Although we are permitted to perform all the forbidden labors necessary to bury a corpse (Chapter 1, Halachot 22-24), rending one's garments is forbidden. this applies even to the relatives of the deceased.

הלכה כד
נָשִׁים בַּמּוֹעֵד בִּפְנֵי הַמֵּת מְעַנּוֹת אֲבָל לֹא מְטַפְּחוֹת וְלֹא מְקוֹנְנוֹת. נִקְבַּר הַמֵּת אֵינָן מְעַנּוֹת. בְּרָאשֵׁי חֳדָשִׁים וַחֲנֻכָּה וּפוּרִים בִּפְנֵי הַמֵּת מְעַנּוֹת וּמְטַפְּחוֹת אֲבָל לֹא מְקוֹנְנוֹת. אֵי זֶהוּ עִנּוּי שֶׁכֻּלָּן עוֹנוֹת כְּאַחַת. קִינָה אַחַת אוֹמֶרֶת וְכֻלָּן עוֹנוֹת. וְאָסוּר לְאָדָם שֶׁיְּעוֹרֵר עַל מֵתוֹ קֹדֶם לָרֶגֶל שְׁלֹשִׁים יוֹם כְּדֵי שֶׁלֹּא יָבֹא הָרֶגֶל וְהוּא נֶעֱצָב וְלִבּוֹ דּוֹאֵג וְכוֹאֵב מִזִּכְרוֹן הַצַּעַר אֶלָּא יָסִיר הַדְּאָגָה מִלִּבּוֹ וִיכַוֵּן דַּעְתּוֹ לְשִׂמְחָה:
כסף משנה
24.
During [Chol Ha]Mo'ed women lament, but they may not pound their hands on each other in grief or mourn. Once the corpse is buried, they may not lament. On Rosh Chodesh, Chanukah and Purim, they may lament and pound their hands on each other in grief before the corpse is buried, but they may not mourn.
What is meant by lamenting? That they all lament in unison. What is meant by mourning? That one recites [a dirge] and the others respond in unison.68See Hilchot Eivel 11:5.
It is forbidden for a person to have a eulogy recited for a deceased person thirty days before the festival,69In Hilchot Eivel 11:6, the Rambam interprets this as referring to a eulogy recited for a person who died more than thirty days before the festival. If a person dies within thirty days of the festival, a eulogy may be recited. This distinction is quoted by the Shulchan Aruch (Orach Chayim 547:3).
This refers even to a eulogy recited without a fee, following the view of Shmuel (Mo'ed Katan 8a).
so that the festival will not arrive when he is sad, and his heart is grieved and hurting, because of the memory of [his] agony. Instead, he should remove the grieving from his heart and direct his attention toward joy.

זמנים הלכות שביתת יום טוב פרק ו
Zemanim Yom Tov Chapter 6