The Prophet (ﷺ) used to offer the prayer earlier if it was very cold; and if it was very hot he used to delay the prayer, i.e. the Jumua prayer.
Sahih al-Bukhari Book 11, Hadith 30