ذِكْرُ الْقَدْرِ الَّذِي صَلَّى فِيهِ الْمُسْلِمُونَ إِلَى بَيْتِ الْمَقْدِسِ قَبْلَ الْأَمْرِ بِاسْتِقْبَالِ الْكَعْبَةِ
"When the Messenger of Allah ﷺ arrived in Al-Madinah, he performed Salat facing the direction of Bait Al-Maqdis (Jerusalem) for sixteen or seventeen months. The Messenger of Allah ﷺ longed to face toward the Ka'bah, so Allah, Might and Sublime is He revealed: Verily, WE have seen the turning of your face towards the heave. Surely, We Shall turn your face in the direction of Al-Masjid Al-Haram (2:144). So he faced the direction of the Ka'bah and he longed for that. (One day) a man performed Salat Al-'Asr along with him." He said: "Then he passed by some people of the Ansar performing Salat Al-'Asr, while they were bowing toward Bait Al-Maqdis. He told them that he testifies that he performed Salat with the Messenger of Allah ﷺ, and he had faced the direction of the Ka'bah." He said: "So they turned while they were bowing." (Using translation from Tirmidhī 2962)
«لَمَّا قَدِمَ النَّبِيُّ ﷺ الْمَدِينَةَ صَلَّى نَحْوَ بَيْتِ الْمَقْدِسِ سِتَّةَ عَشَرَ شَهْرًا أَوْ سَبْعَةَ عَشَرَ شَهْرًا وَكَانَ يُحِبُّ أَنْ يُوَجَّهَ إِلَى الْكَعْبَةِ فَأَنْزَلَ اللَّهُ جَلَّ وَعَلَا {قَدْ نَرَى تَقَلُّبَ وَجْهِكَ فِي السَّمَاءِ فَلَنُوَلِّيَنَّكَ قِبْلَةً تَرْضَاهَا فَوَلِّ وَجْهَكَ شَطْرَ الْمَسْجِدِ الْحَرَامِ} فَمَرَّ رَجُلٌ عَلَى قَوْمٍ مِنَ الْأَنْصَارِ وَهُمْ رُكُوعٌ فَقَالَ هُوَ يَشْهَدُ أَنَّهُ قَدْ صَلَّى مَعَ رَسُولِ اللَّهِ ﷺ وَأَنَّهُ وَجَّهَ إِلَى الْكَعْبَةِ»