The legislation is meant to put an end to a protracted period in which city officials have shuffled the primary across the calendar to avoid breaking federal law, which requires that general-election ballots be sent to overseas voters at least 45 days before election day.