(a) A person may not sell, barter, give, consume, or dispose of alcoholic beverages within licensed premises
(1) in the state on a day on which a statewide special, primary, or general election is held for the purpose of voting for a candidate for public office, until the polls have closed;
(2) in a municipality on a day on which a local option election or an election is held for the purpose of voting for a candidate for public office, until the polls are closed.
(b) The governing body of a municipality may provide by ordinance that the provisions of this section do not apply in a municipality.