Split for capital gains when moving

If you move states halfway through the year can yo still allocate 50/50 for capital gains?  Can you deduct capital losses taken in second half of year against gains from first half of year?