1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:07:45 +00:00

cal: Center the month-year text

For now this only has an effect when displaying two-digit years, but
when month names get implemented this will be helpful.
This commit is contained in:
Karol Baraniecki 2023-03-04 00:01:42 +01:00 committed by Andrew Kaster
parent 119dc042ab
commit 905f2ca152

View file

@ -29,7 +29,7 @@ static ErrorOr<Vector<String>> month_lines_to_print(int month, int year)
Vector<String> lines;
// FIXME: Both the month name and month header text should be provided by a locale
TRY(lines.try_append(TRY(String::formatted(" {:02} - {:02} ", month, year))));
TRY(lines.try_append(TRY(String::formatted("{:^20s}", TRY(String::formatted("{:02} - {:02}", month, year))))));
TRY(lines.try_append(TRY(String::from_utf8("Su Mo Tu We Th Fr Sa"sv))));
int day_to_print = 1;