diff --git a/Examples-and-Recipes.md b/Examples-and-Recipes.md index 7c5c6b5..9da5601 100644 --- a/Examples-and-Recipes.md +++ b/Examples-and-Recipes.md @@ -1356,18 +1356,18 @@ First the code, and then a detailed explanation: { case 0: // Output month and year title - os << left << setw(21) << format(os.getloc(), " %B %Y", sys_days{ym/1}) << right; + os << left << setw(21) << format(os.getloc(), " %B %Y", ym) << right; break; case 1: { // Output weekday names title - auto sd = sys_days{ym/firstdow[1]}; - for (auto const esd = sd + weeks{1}; sd < esd; sd += days{1}) + auto wd = first dow; + do { - auto d = format(os.getloc(), "%a", sd); + auto d = format(os.getloc(), "%a", wd); d.resize(2); os << ' ' << d; - } + } while (++wd != firstdow); break; } case 2: @@ -1378,7 +1378,7 @@ First the code, and then a detailed explanation: auto d = 1_d; do { - os << setw(3) << unsigned(d); + os << format(" %e", d); ++d; } while (++wd != firstdow); break; @@ -1399,7 +1399,7 @@ First the code, and then a detailed explanation: auto wd = firstdow; do { - os << setw(3) << unsigned(d); + os << format(" %e", d); } while (++wd != firstdow && ++d <= e); // Append row with spaces if the week did not complete os << string(static_cast((firstdow-wd).count())*3, ' ');