S HASHAUNA PHILLIPS , a 43-year-old single mother in Charleston, South Carolina, loves her job at Walmart. There is just one problem. As a customer-service manager, responsible for supervising cashiers and keeping customers happy among other things, she is rarely given consistent working hours. “One week I might have four days on the schedule and the following week I might have two,” Ms Phillips says. “It makes my life a struggle.” Things may be getting better. Walmart has launched a new scheduling system that will give its 1.5m domestic workers more predictable shifts. As the labour market tightens, and state and local lawmakers clamp down on unpopular scheduling practices, more firms are likely to follow.

Over the past decade, American big-box retailers, supermarkets and fast-food chains have relied on workforce-management software to match worker supply and demand. Such systems boost profitability by scheduling only the minimum number of employees needed to keep lines moving and cash registers ringing. But they also encourage practices like keeping workers on-call for shifts that may never materialise, or sending them home early when business is slow. This kind of just-in-time scheduling is widely disliked by workers. A study published in 2017 found that the average worker is willing to give up 20% of wages to avoid an irregular schedule set by an employer on short notice.

Lawmakers in Congress have left the question for companies to resolve. The Schedules That Work Act, which would force retailers to set schedules two weeks in advance and pay employees extra for any last-minute changes, has languished. States and city governments have done more. In 2014, San Francisco became the first big city to regulate scheduling practices. “To be honest, it’s been fairly smooth from what I can tell,” says Jim Lazarus of the San Francisco Chamber of Commerce. Seattle passed similar “fair work-week” legislation in 2016, followed by New York City and the state of Oregon in 2017. Chicago and Philadelphia are considering similar bills.

Some companies have also implemented reforms in response to public pressure. In 2014, after an unflattering report by the New York Times, Starbucks announced an end to “clopenings”, the practice of scheduling an employee to close a shop late in the evening and return hours later to open it the next morning. The next year, more than a half a dozen retailers including Abercrombie & Fitch, J.Crew and Victoria’s Secret agreed to end on-call scheduling after New York’s attorney-general began investigating the legality of the practice.

Economic pressure may prove yet more powerful. Saravanan Kesavan, of the University of North Carolina, says retailers are “scheduling people like widgets in a factory”. This cuts costs in the short term, but may also lead to higher employee turnover, absenteeism and poor service. A recent paper by Mr Kesavan and others found that employee-friendly scheduling—keeping shifts more consistent and allowing workers to swap shifts via a mobile app—boosted sales at a group of Gap stores by an average of 7%. As wages rise, and workers become more scarce, more employers are likely to learn this lesson. “When there are no jobs around, workers have to put up with unpredictable schedules,” Mr Kesavan says. Now, “they can walk across the street to another retailer.”