Taanis 2:10
The chachamim would not decree a fast day on the public to begin with on Rosh
Chodesh, Chanukah or Purim, however, once they started fasting they would even
fast on those days. These are the words of R’ Gamlial.
R’ Meir says even if they start fasting before these days they can
continue but they shouldn't finish the fast but break before night.
The same is true if Tisha Bav fell out on Friday that you do not finish the
fast. [This could only happen before we had a calendar]
Taanis 3:1
For lack of rain we already said the order of how to fast. However, if there
was enough rain but the grains changed color, we sound the shofar right away
which includes establishing a fast. The same is true if it started raining and
then stopped for 40 days as drought is not far behind.