عَنْ جَابِرِ بْنِ عَبْدِ اللَّهِ رَضِيَ اللَّهُ عَنْهُ قَالَ: سَمِعْتُ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ يَقُولُ: ((إِنَّ الشَّمْسَ وَالْقَمَرَ إِذَا خَسَفَا أَوْ أَحَدُهُمَا، فَإِذَا رَأَيْتُمْ ذَلِكَ فَصَلُّوا حَتَّى يَنْجَلِيَ خُسُوفُ أَيِّهِمَا خَسَفَ))
It is narrated from Sayyiduna Jabir bin Abdullah, may Allah be pleased with him, that the Messenger of Allah, peace and blessings be upon him, said: When the sun and the moon or one of them loses its light and you see this occurrence, then perform prayer until the eclipse is over, whichever it has affected.