Among the early Tannaim there was "Megillat Taanit," which were the days that the Holy One, Blessed be He, performed miracles for Israel, and those days were forbidden for eulogy and fasting. And it was taught in Rosh Hashanah (19b): These days written in Megillat Taanit, whether in the time that the Beit HaMikdash exists, or in the time that the Beit HaMikdash does not exist—they are forbidden; these are the words of Rabbi Meir. Rabbi Yossi says: (...) In the time that the Beit HaMikdash does not exist—they are permitted. And the halacha is like Rabbi Yossi. And the Shas ruled there that the halacha is that Megillat Taanit is nullified, except for Chanukah and Purim, which are forbidden for fasting on the days themselves. But before them and after them is permitted in this time, even though in the time of the Mikdash they were forbidden. And all of Megillat Taanit—even on these days they are permitted, and all the more so before them and after them. And so too Sabbaths and Yamim Tovim, and Roshei Chodashim—it is permitted to fast both before them and after them. And this was so even in the time of the Mikdash. And the reason for the matter is this: that which they forbade in the time of the Mikdash regarding Megillat Taanit to fast before them and after them—was in order to strengthen the matter of the days themselves. And this applies to Rabbinic decrees which require strengthening, but Sabbath and Yamim Tovim and Rosh Chodesh, for which it is forbidden to fast by the Torah, anything from the Torah does not require strengthening. (Rosh Hashanah ibid. And there it is explained that Rosh Chodesh is from the Torah, see there. And see the end of siman 570, and it requires further study.)
אצל התנאים הקדמונים היתה "מגילת תענית", והיינו הימים שהקדוש ברוך הוא עשה נסים לישראל, והיו אותן הימים אסורין בהספד ובתענית. ותניא בראש השנה (יט ב): הימים האלה הכתובים במגילת תענית, בין בזמן שבית המקדש קיים, ובין בזמן שבית המקדש אינו קיים – אסורין; דברי רבי מאיר. רבי יוסי אומר: (…) בזמן ש[…]אין בית המקדש קיים – מותרין. והלכה כרבי יוסי. ופסק הש"ס שם דהלכתא דבטלה מגילת תענית, לבד חנוכה ופורים שאסור להתענות בהם בעצמן. אבל לפניהם ולאחריהם מותרים בזמן הזה, אף על גב דבזמן המקדש היו אסורין. וכל מגילת תענית – גם בימים אלו מותרים, וכל שכן לפניהם ולאחריהם. וכן שבתות וימים טובים, וראשי חודשים – מותרין להתענות בין מלפניהן ובין מלאחריהן. וזה היה אפילו בזמן המקדש. וטעמא דמילתא כן הוא: דזה שאסרו בזמן המקדש במגילת תענית להתענות לפניהן ולאחריהן – כדי לחזק העניין של הימים עצמם. וזה שייך בדרבנן דצריכין חיזוק, אבל שבת וימים טובים טוב וראש חודש דמן התורה אסור להתענות בהן, וכל דאורייתא לא בעי חיזוק. (ראש השנה שם. ושם מבואר דראש חודש דאורייתא, עיין שם. ועיין סוף סימן תקע, וצריך עיון.)