State tax filing

I think the key question I am trying to get answered here is, both the stock reward and the annual bonus are for the performance of the year. If I stayed at VA for the month I got the stock does 100% of the stock tax goes to VA or just the x month/12 percent of the earning? Same question goes to the bonus I received after becoming a CA resident. The bonus was decided before I quit my job and it was sent out afterwards, which date does it matter? is it the date it gets to my bank or is it the date it was supposed to be granted?