It was narrated from Ibn 'Umar that 'Umar had vowed -during the Jahiliyyah- to spend a day in 'Itikaf. He asked the Messenger of Allah about that, and he commanded him to perform the 'Itikaf. (Using translation from Nasāʾī 3822)
أَنَّ عُمَرَ كَانَ قَدْ جَعَلَ عَلَيْهِ يَوْمًا يَعْتَكِفُهُ فِي الْجَاهِلِيَّةِ فَسَأَلَ رَسُولَ اللهِ ﷺ عَنْ ذَلِكَ «فَأَمَرَهُ أَنْ يَعْتَكِفَ»