For additional fun, consider how this would work with the added constraint of needing the date be a business day, so you need to take into account how weekends (which vary across the world, by the way; in a bunch of countries sunday is a business day but friday is off) and banking holidays in every locale in which you do business.
For reference, in China there are a bunch of legally mandated holidays that convert the weekend days around them into normal working days. (The conversion is not legally mandated; think of it as a response to laws that generate many more holidays than the economy supports.)