State tax filing

If I have one W2 from my employer. And I became nonresident of CA state in mid-June.

How can I divide income per W2 as a CA resident and CA non-resident? Add up income of each pay statements till end of June for CA resident tax filing ? 

 

For Federal tax returns, I guess I input the amount of income without dividing.

 

thank you