All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
Conditional vows are disliked. The Prophet, sallallaahu ‘alayhi wa sallam, informed that they do not bring about good and that they are only a means to extract money from miserly people. Scholars agreed that if one makes a vow of piety contingent upon a certain condition and that condition takes place, he should then fulfill his vow. It was authentically narrated on the authority of ‘Aa’ishah that the Prophet, sallallaahu ‘alayhi wa sallam, said: “If one vowed to obey Allaah Almighty, he should obey Him.” This sister should fear Allaah Almighty, fulfill her vow, and consider fulfilling it an expression of gratitude for the favors of Allaah, the Exalted, that He bestowed upon her.
She will remain liable to this vow until she fulfills it as long as she is not unable to fast. Concerning consecutiveness, the majority of the scholars viewed that if one vowed to fast and did not state the condition of consecutiveness, he is then not obliged to fast consecutively. Consecutiveness is obligatory if one stated it as a condition or vowed to fast in a certain period. Ash-Sheerazi said in Al-Muhaththab: “In case one vowed to fast for an unspecific year, if he did not state the condition of consecutiveness, then it is permissible for him to fast it consecutively or separately because the vow encompasses both.”
If these two months have not been specified, as appears from the question, then she may fast them either consecutively or separately. If she fasts according to crescent sighting, then it avails her to fast for two months, even if the month is less than thirty days in case she fasts them consecutively. However, if she fasts them separately, then she should fast sixty days. This is the opinion of the majority of the scholars.
Allaah Knows best.