Multiple states

For the year 2020, I lived in NH (tax-free state) for the Jan-2020, and for the rest of the year, I was in IL. 
 
So, my question is all the capital gains which I had made in 2020, do I have to pay the taxes in IL for all the 12 months or will it be pro-rated for 11 months? 
 
e.g. If I had made $12,000 in capital gains in 2020, do I have to pay the IL state tax for the entire year or pro-rate the amount to 11 months that will become $11000 and pay taxes on it.