[Machine] I heard Saad say that the Messenger of Allah ﷺ prayed after he arrived in Medina for about sixteen months towards the direction of Beit Al-Maqdis (Jerusalem). Then after that, the direction was changed towards the Sacred Mosque (in Mecca) two months before the Battle of Badr, like this.
سَمِعْتُ سَعْدًا يَقُولُ صَلَّى رَسُولُ اللهِ ﷺ بَعْدَ مَا قَدِمَ الْمَدِينَةَ سِتَّةَ عَشَرَ شَهْرًا نَحْوَ بَيْتِ الْمَقْدِسِ ثُمَّ حُوِّلَ بَعْدَ ذَلِكَ قِبَلَ الْمَسْجِدِ الْحَرَامِ قَبْلَ بَدْرٍ بِشَهْرَيْنِ هَكَذَا