I lived in CA for 7mo and NY for 5mo. I will receive a year end bonus (3x base salary) on 12/31 when I am in NY. Should I be paying 7mo CA taxes and 5mo NY on the bonus?

Hello I am desperate for help here! I will be getting a large year end performance bonus on 12/31 (when I will be living in NY) but I lived in CA for 7 months out of the year. I transferred offices internally at my company and fully moved from our CA office to our NY office. Should I allocate the bonus based on time spent throughout the year or pay taxes only to NY on the bonus payment?