Did the Pandavas really complete the terms of their ajnatavasa (living in concealment)? Or were their hidden identities revealed before its completion and hence it was adharma to fight against the Kauravas?
At first, as per Duryodhana, they didn't complete:
Vaisampayana said, 'King Duryodhana then, on the field of battle said unto Bhishma, and unto Drona--that tiger among warriors, and unto Kripa--that mighty car-warrior, these words, 'Both myself and Kama had said this unto the preceptors 1 I refer to the subject again, for I am not satisfied with having said it once. Even this was the pledge of the sons of Pandu that if defeated (at dice) they would reside to our knowledge in countries and woods for twelve years, and one more year unknown to us. That thirteenth year, instead of being over, is yet running. Vibhatsu, therefore, who is still to live undiscovered hath appeared before us. And if Vibhatsu hath come before the term of exile is at end, the Pandavas shall have to pass another twelve years in the woods. ~ Mahabharata: Virata Parva: Go-harana Parva: Section XLVII
But, later Bhishma explained and as per this explanation, they completed:
Bhishma said, 'The wheel of time revolves with its divisions, viz., with Kalas and Kasthas and Muhurtas and days and fortnights and months and constellations and planets and seasons and years. In consequence of their fractional excesses and the deviations of also of the heavenly bodies, there is an increase of two months in every five years. It seems to me that calculating this wise, there would be an excess of five months and twelve nights in thirteen years. Everything, therefore, that the sons of Pandu had promised, hath been exactly fulfilled by them. Knowing this to be certain, Vibhatsu hath made his appearance. ~ Mahabharata: Virata Parva: Go-harana Parva: Section LII
This is explained in Mahabharata - SanskritHindi version from GitaPress by Pandit Ramnarayan commentary in more detail:
The English translation (as per my understanding) of above screenshot would be as below:
- Lunar year: 354 days + few hrs
- Solar year: 365 days + few hrs
13 Solar years = (365 * 13) = 4745 days + few days
13 Lunar years = (354 * 13) = 4602 days + few days
So there is a difference of around 5 months in both the calculation. As per Pandit Ramnarayan's commentary, Pandavas considered Solar calculation, so as per them, they just completed 13 years. But, Bhisma considered Lunar calculation along with Adhika masa, so as per him Pandavas exceeded 5 months and 12 days after completing 13 years.
By this explanation, Pandavas completed agreed 13 years as per both Solar and Lunar (including & excluding Adhika masa) calculations.
As mentioned in below answer, one who believe in Lunar calculation mentioned that Pandvas completed 13 years term even before [5 months] Arjuna reveals his identity. But Pandavas themselves were believing Solar calculation so they appeared when they completed 13 years in every calculation.
As you can see, difference is due to Adhik Masa, Lunar calculation and Solar calculation. After, Bhisma's explanation Duryodhana somehow seems to be convinced and instead of sending them again in woods for 12 years, he prepared to fight:
"Duryodhana said, 'I will not, O grandsire, give back the Pandavas their kingdom. Let every preparation, therefore, for battle be made without delay.'
The Mahābhārata isn't very clear on this issue.
On one hand, before go-grahaṇa (the seizing of cattle by King Suśarma of Trigata and the Kauravas), we have a statement from Vaiśampāyana (speaking to Janamejaya) that the Pāṇḍavas just completed their 13th year in exile. This is even before Arjuna reveals his identity to Uttara and the Kauravas:
Virāṭa Parva - Ch. 29
Vaishampayana said, ...
O lord of the earth! As commanded, Susharma marched in a south-eastern direction. He began to rob the cattle on the seventh lunar day of dharmapaksha. O king! On the following day, the eighth day, all the Kouravas joined forces and robbed thousands of cowsheds.
Virāṭa Parva - Ch. 30
O great king! The infinitely energetic and great-souled Pandavas had adopted disguises and dwelt in Virata's excellent city. While they lived there, the promised period elapsed. They performed tasks for Virata, lord of the earth. O descendant of the Bharata lineage! After the end of the thirteenth year, Susharma swiftly robbed a large number of cattle. A herdsman then arrived at the city with great speed and descended from his chariot. He saw the king of Matsya seated, wearing earrings and bracelets. He was surrounded by brave warriors, all adorned with earrings and armlets. He was surrounded by his advisers, together with the Pandavas, bulls among men. The great king, the extender of the kingdom, was seated in his assembly hall. He approached Virata, bowed in worship, and said,
The Trigartas have vanquished us, together with our relatives, in battle. They are taking away hundreds and thousands of cattle. O Indra among men! Rescue your animals quickly, or they will be lost.
When he heard this, the king of Matsya assembled his army.
On the other hand, after the Virāṭa war has just been won, we see some kind of arrangement between Arjuna and Uttara to not reveal Arjuna's identity until after a few days.
Virāṭa Parva - Ch. 64
Where is that brave and mighty-armed one, the immensely famous son of a god? He is the one who has won back my riches, which had been conquered by the Kurus in battle. I wish to see that immensely strong one and show him homage. That son of a god has protected you and my cattle.
O father! The powerful son of a god disappeared. But I think that he will reappear tomorrow, or the day after.
While this was being described, Pandava (Arjuna) remained concealed in his disguise. Virata did not know that Partha Arjuna was residing there. Having obtained the great-souled Virata's permission, Partha himself gave those garments to Virata's daughter. They were extremely expensive and fine and the beautiful Uttara happily accepted those garments. O king! Kounteya then secretly devised a plan with Uttara, 20 about everything that should be done vis-à-vis Yudhishthira. O bull among the Bharata lineage! Together with Matsya's son, the bull among men cheerfully carried this out.
20 Arjuna and Prince Uttara respectively. Arjuna and Uttara decided on a plan for the Pandavas to reveal themselves.
And as planned Yudhiṣṭhira finally reveals the Pāṇḍava identities on the third day after the Virāṭa war. The reason for the wait, as the footnote by the translator explains, is that they have now completed the 13th year of exile.
Virāṭa Parva - Ch. 65
On the third day, the five Pandava brothers bathed themselves and donned white garments, having completed the pledge that they had made. 21 Adorning themselves in ornaments, and with Yudhishthira at the forefront, the maharathas were as resplendent as elephants marked with the signs of the lotus. They went to Virata's assembly hall and seated themselves on thrones meant for lords of the earth. They were as radiant as fires on sacrificial altars. While they were seated there, Virata, lord of the earth, arrived at the assembly hall to perform all his royal duties. On seeing the handsome Pandavas, blazing like fires, with Kanka seated there in the form of a god, like the lord of the thirty gods attended by the Maruts, Matsya told him, "I put you in charge of the dice and appointed you the official gamester. Why are you ornamented and why are you seated on the royal throne?"
On hearing Virata's words, Arjuna laughed and spoke the following words. "O king! This one deserves to be seated on Indra's throne. He has the qualities of a brahmana. He is learned in the sacred texts. He is generous. He is the performer of sacrifices. He is rigid in his vows. He is a bull among the Kurus. He is Kunti's son, Yudhishthira.
21 Of living in concealment for the thirteenth year.
Again, on one side of the Virāṭa war, we see Arjuna (Bṛhannala) not too worried about exposing his identity to Uttara and the Kauravas. This is because he thinks the Pāṇḍavas have already completed the thirteenth year in disguise.
Virāṭa Parva - Ch. 40
I am telling you truthfully, I have observed this vow for a year, on the instructions of my elder brother. I have observed brahmacharya. O mighty-armed one! I am not a eunuch, but united with dharma, have followed another. O son of a king! Know that my vow has been completed. 72
72 Because the one year of disguise is over.
On the other side of the war, a few chapters earlier, we find Yudhiṣṭhira warning Bhīma not to fight with an uprooted tree as that will reveal his true self.
Virāṭa Parva - Ch. 32
With the king of Matsya having lost his chariot, he (Susharma) captured him alive. Susharma molested him, like one driven by lust acting towards a weeping bride. He made him ascend his own chariot and departed with his swift steeds. 'Virata was supremely strong. But he was bereft of his chariot and was captured. The Matsyas, oppressed by the Trigartas, were frightened and fled. On seeing that they were terrified, Yudhishthira, Kunti's son, spoke to the mighty-armed Bhimasena, the destroyer of enemies.
Susharma of Trigarta has captured the king of the Matsyas. O mighty-armed one! Free him, so that he does not fall into the clutches of the enemy. All of us have lived happily in his house. All our wishes have been met and we have been honoured well. O Bhimasena! You must act thus and free us of the debt we owe him for our dwelling there.
O king! On your instructions, I will free him. Behold my extremely great deed when I fight with the enemies. Resorting to the strength of your arms, stand here, on one side, together with our brothers. Witness my valour now. This gigantic tree stands here, with a well-formed trunk that is like a club. I will uproot it and drive away the enemies.
On seeing that his brave brother was glancing at the tree, like an angry elephant, Dharmaraja Yudhishthira spoke to him.
O Bhima! Do not act rashly. Let the tree stand there. You should not perform such superhuman deeds with a tree. O descendant of the Bharata lineage! People will then recognize you to be Bhima. Get hold of some other weapon that is used by men—a bow, or a spear, a sword or a battleaxe. O Bhima! Grasp a weapon used by humans and free the lord of the earth, so that you are not noticed by others...