SEATTLE — Retail and food-service workers will have more predictability with their schedules after the Seattle City Council unanimously approved a new law Monday requiring employers to schedule shifts 14 days in advance and pay workers extra for certain last-minute scheduling changes.

Seattle is the second major U.S. city behind San Francisco to pass such scheduling legislation.

“Seattle is again a national leader in workers’ rights,” said Councilwoman Lisa Herbold, who co-sponsored the legislation and noted that the city has also phased in a $15 hourly minimum wage and mandated sick leave for many companies.

Supporters, including the mayor and labor-backed groups, say the law would address the erratic schedules and fluctuating work hours that make it difficult for people to juggle child care, school or other jobs, to count on stable income, or to plan for the future.

Backers cheered and applauded when the final vote was announced.

The Washington Retail Association and other businesses have criticized the proposal. They say the measure is too restrictive, imposes burdensome bookkeeping and fines and would lead to more problems and less flexibility for workers.

Across the country, companies have faced increasing pressure to make schedules for their workers more predictable and reliable. In July, Wal-Mart launched a new scheduling system to give thousands of hourly employees more certainty about their hours.

“We are shifting the power to workers so that you as workers can influence and shape your schedules, and that is a critical part of our promise of fulfilling the $15 minimum wage and combating economic inequality in our city,” said Councilwoman Lorena Gonzalez, who co-sponsored the legislation.

She and Herbold said scheduling practices designed to control labor costs by scheduling workers within short notice disproportionately affect people of color, particularly women. “I believe this law strikes a balance between the desire for flexibility and the need for economic and life security,” Gonzalez added.

In Seattle, the law applies to retail and fast-food companies with 500 employees globally and to full-service restaurants with 500 employees and 40 establishments. Violators could be subject to civil fines.

The law also requires companies to compensate workers with “predictability pay” when they’re scheduled but don’t get called into work or are sent home early; set a minimum 10 hours rest between open and closing shifts; offer hours to existing employees before hiring new staff; and provide workers with a written good faith estimate of their expected hours.

It exempts companies whose employees are covered by a collective bargaining agreement with similar scheduling provisions.

Some employers have previously told council members that they already work collaboratively to ensure they meet workers’ scheduling needs and that the onerous rules could drive them out of the city.