The Messenger of Allah ﷺ commanded us that the end of Ramadan when the fasting is closed sadaqah(alms) should be paid before the people went to prayer. ‘Abd Allah b. ‘Umar used to pay it one or two days before.
أَمَرَنَا رَسُولُ اللَّهِ ﷺ بِزَكَاةِ الْفِطْرِ أَنْ تُؤَدَّى قَبْلَ خُرُوجِ النَّاسِ إِلَى الصَّلاَةِ قَالَ فَكَانَ ابْنُ عُمَرَ يُؤَدِّيهَا قَبْلَ ذَلِكَ بِالْيَوْمِ وَالْيَوْمَيْنِ