membership duration

hello, the membership duration it's set for d, month, or year.
Is it possible to set memberships that ends automatically at the end of the year?
If you subscribe the 17h january or 4th April, the suscriptions end the 12/31of that year.
how can i manage it?
i though my changing a value of the 'period' => $level->level_period in the array of the function function get_pricingarray()? Am i correct? can you guys lead me in that improvment?
Thank you.