Taxes on capital gains and dividends on securities bought in while living IN and sold while living in IL

I stayed in IN for some part of the year than moved to IL. I bought some stocks and mutual funds while I was living in IN and sold them when moved to IL. I also got some capital gains and dividends on them.

 

How should I be calculating state tax on this part of my income?

 

Additional Info: I am an international citizen with Resident Alien tax status in the US. I will be filing my taxes as married filing jointly.

 

Please feel free to ask for clarifications.