The people used to fast on 'Ashura (the tenth day of the month of Muharram) before the fasting of Ramadan was made obligatory. And on that day the Kaʿba used to be covered with a cover. When Allah made the fasting of the month of Ramadan compulsory, Messenger of Allah ﷺ said, "Whoever wishes to fast (on the day of 'Ashura') may do so; and whoever wishes to leave it can do so."
أَنْ يُفْرَضَ رَمَضَانُ وَكَانَ يَوْمًا تُسْتَرُ فِيهِ الْكَعْبَةُ فَلَمَّا فَرَضَ اللَّهُ رَمَضَانَ قَالَ رَسُولُ اللَّهِ ﷺ مَنْ شَاءَ أَنْ يَصُومَهُ فَلْيَصُمْهُ وَمَنْ شَاءَ أَنْ يَتْرُكَهُ فَلْيَتْرُكْهُ