DOES A NEDER TO FAST OVERRIDE MITZVOS? [Nedarim: Ta'anis]
Gemara
Nedarim have a stringency over Shevu'os, i.e. they take effect even on Mitzvos.
66a (Mishnah): We may be Pose'ach by pointing out that a vow includes Shabbos and Yom Tov.
At first, Chacham thought that only Shabbos and Yom Tov are permitted (after regret). R. Akiva taught that a vow that was partially permitted is totally permitted.
Ta'anis 12a: If one accepted to fast the entire year, and Yomim Tovim in Megilas Ta'anis came, he fasts only if he accepted before the Yom Tov was enacted.
Rishonim
Rif (22a): We may be Pose'ach with Shabbos and Yom Tov.
Rambam (Hilchos Ta'anis 1:9): An individual should fast over his problems. He does not fast on Shabbos, Yom Tov, Rosh Chodesh, Chanukah or Purim.
Magid Mishneh: If a Tzibur already began fasting, they fast even on Rosh Chodesh. The acceptance of an individual is not so strong.
Rambam (Hilchos Nedarim 3:9): If one vowed to fast on Shabbos or Yom Tov, he must fast, for vows are Chal (take effect) on Mitzvos.
Radvaz: The Yerushalmi explicitly says so.
Kesef Mishneh: This is explicit in the Mishnah (66a). A Stam vow includes Shabbos and Yom Tov. If he realized this at the time he vowed, or if he explicitly forbade Shabbos and Yom Tov, it is Chal.
Note: The Mishnah does not specify whether it discusses a vow to fast (like Perush ha'Rosh 66a DH Masnisin), a vow against wine (Tosfos 66a DH Poschin), or something that is not a Mitzvah, e.g. turkey or apples!
Ra'avad: This is only if he said 'Alai (it is upon me). If he said 'I am in a fast', he is forbidden (to fast).
Kesef Mishneh: If he said Alai, this is a Neder. Saying that he will fast is a Shevu'ah and it is not Chal, like the Ra'avad said. The Rambam agrees. In Hilchos Ta'anis (1:9), he says that an individual fasting over his problems does not fast on Shabbos or Yom Tov. Surely, we must answer that there, he swore not to fast!
Rambam (ibid.): Similarly, if one vowed to fast every Sunday or Tuesday, and one of them occurred on Yom Tov or Erev Yom Kipur, he must fast. We need not say that if Rosh Chodesh occurred, he must fast. If Chanukah or Purim occurred, they override his vow. Since the Isur to fast on them is mid'Rabanan, it needs to be strengthened. Chachamim's decree overrides his vow.
Beis Yosef (OC 418 DH u'Mashma): This connotes that mid'Oraisa one may not fast on Erev Yom Kipur and Rosh Chodesh. This is not true. It is mid'Rabanan! However, there are Asmachtos for these, so people will not disgrace them, therefore we need not strengthen them. The Asmachta for Rosh Chodesh was better known than that for Erev Yom Kipur.
Rosh (9:5): An acceptance to fast overrides Yomim Tovim in Megilas Ta'anis only if he accepted before the Yom Tov was enacted. Some say that even though Nedarim are Chal on Mitzvos, and one must permit Shabbos and Yom Tov. Chachamim strengthened the decree of Megilas Ta'anis more than days when the Torah forbids fasting. Some explain that when the enactment came first, his Neder is overridden, i.e. he asks a Chacham to permit it. Some say that we discuss a mere acceptance to fast. It was not a Neder. It is not strong enough to override Yom Tov, or even days in Megilas Ta'anis. In the Yerushalmi, some say that if one vowed to fast and days of Megilas Ta'anis occurred, he fasts but does not complete the fast. Chachamim say that he is lashed, i.e. mid'Rabanan, and need not permit his vow.
Poskim
Shulchan Aruch (YD 215:2): If one vowed to fast for a certain period, and Shabbos, Yom Tov or Rosh Chodesh occurred, we are Pose'ach for him and say 'had you considered that these days will be included, would you have vowed?' (If he says 'no',) the entire vow is permitted.
Beis Yosef (DH u'Mah she'Chosav v'Chen): Obviously, the Neder is Chal, for Nedarim are Chal on Mitzvos. The Chidush is that permitting Shabbos and Yom Tov permits the entire vow. The Kolbo says that the vow forbids Yom Tov only if he intended for this. If he vowed Stam, and would not have vowed had he realized that Yom Tov will be on this day, the vow is Batel also regarding days in Megilas Ta'anis. Rabbeinu Peretz says that 'we are Pose'ach with Shabbos and Yom Tov' connotes that he must permit the vow. He should not fast; rather, we permit the vow.
Shulchan Aruch (3): It must be permitted when he used the text of a vow, e.g. 'Konam is eating on these days.' If he accepted fasts, it does not override Shabbos, Yom Tov, Rosh Chodesh, Chanukah or Purim. He need not permit it, even if he accepted to fast only on Shabbos and Yom Tov.
Shulchan Aruch (4): If one accepted in the text of a vow to fast on Shabbos and Yom Tov, it is Chal. The same applies to one who vowed to fast every Sunday or Monday, and one of them occurred on Yom Tov or Erev Yom Kipur, he must fast. We need not say that if Rosh Chodesh occurred, he must fast. If Chanukah or Purim occurred, his vow is void.
Beis Yosef (DH v'Chosav b'Sefer): Why does the Tur distinguish between an explicit vow to fast on Shabbos and Yom Tov and when they occurred on days he accepted. These have the same law!
Rema: The Shulchan Aruch ruled differently in OC 570:1
Shulchan Aruch (OC 418:3): If one vowed to fast on certain days, and one of them occurred on Rosh Chodesh, or he merely accepted to fast on Rosh Chodesh, he need not permit it.
Mishnah Berurah (7): If he vowed to fast every Monday and Thursday for a year or some months, he need not compensate for not fasting on Rosh Chodesh. If he vowed a certain number of fasts, he must compensate.
Shulchan Aruch (ibid.): If he accepted by saying 'Harei Alai', the text of a Neder, a Chacham must permit it.
Shulchan Aruch (570:1): If one vowed to fast on certain days, and one occurred on Shabbos, Yom Tov, Rosh Chodesh, Chanukah, Purim or Erev Yom Kipur,:
If he merely accepted to fast, he need not permit it;
If he said 'Harei Alai', the text of a Neder, a Chacham must permit it. He says 'had you realized that these days will occur, would you have vowed?' The Rambam always requires fasting if he does not permit it, except for Chanukah and Purim, which are mid'Rabanan, and need to be strengthened.
Taz (1): A Neder takes effect on a Mitzvah, but a Shevu'ah does not.
Kaf ha'Chayim (4): The oath of Sinai includes mid'Rabanan laws, due to "Al PI ha'Torah Asher Yorucha". This is even if he was Kolel with permitted days.
Magen Avraham (2,3): Saying 'I vow to fast' is not a vow. If he said 'Harei Alai', did not permit it, and fasted, he must fast another day to atone for this.
Rema: The custom follows the first opinion.