In Lochner v. New York (1905), the Supreme Court invalidated a law which forbid bakers from working more than 60 hours a week or ten hours a day.
In doing so, the Supreme Court reinforced the right to contract and articulated a test wherein there needed to be a rational basis for these type of limitations.
Lochner was eventually overturned in the case West Coast Hotel as the New Deal took effect.