1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

cal: Pad days on the left with spaces instead of zeroes

I think this looks a lot prettier:
          1  2  3  4
 5  6  7  8  9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

than that:
         01 02 03 04
05 06 07 08 09 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
This commit is contained in:
Karol Baraniecki 2023-03-04 01:58:13 +01:00 committed by Andrew Kaster
parent af2a606f25
commit b4bec4dd2f

View file

@ -71,7 +71,7 @@ static ErrorOr<Vector<String>> month_lines_to_print(Header header_mode, int mont
if (year == current_year && month == current_month && day == current_day) {
TRY(days_in_row.try_append(TRY(String::formatted(ANSI_INVERT_OUTPUT "{:2}" ANSI_RESET_OUTPUT, day))));
} else {
TRY(days_in_row.try_append(TRY(String::formatted("{:02}", day))));
TRY(days_in_row.try_append(TRY(String::formatted("{:2}", day))));
}
day++;
}