mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
g_date_time_format: fix padding for some formats
%e is supposed to be space-padded and %W is supposed to be 0-padded Adjust the testcase accordingly since it expects the wrong behaviour.
This commit is contained in:
parent
b4591aa3dc
commit
65fe8b73c5
@ -2446,7 +2446,7 @@ g_date_time_format (GDateTime *datetime,
|
||||
g_string_append_printf (outstr, fmt, g_date_time_get_day_of_month (datetime));
|
||||
break;
|
||||
case 'e':
|
||||
get_numeric_format (fmt, sizeof(fmt), alt_digits, pad_set ? pad : 0, 2);
|
||||
get_numeric_format (fmt, sizeof(fmt), alt_digits, pad_set ? pad : ' ', 2);
|
||||
g_string_append_printf (outstr, fmt, g_date_time_get_day_of_month (datetime));
|
||||
break;
|
||||
case 'g':
|
||||
@ -2568,7 +2568,7 @@ g_date_time_format (GDateTime *datetime,
|
||||
}
|
||||
break;
|
||||
case 'W':
|
||||
get_numeric_format (fmt, sizeof(fmt), alt_digits, 0, 0);
|
||||
get_numeric_format (fmt, sizeof(fmt), alt_digits, '0', 2);
|
||||
g_string_append_printf (outstr, fmt, g_date_time_get_day_of_year (datetime) / 7);
|
||||
break;
|
||||
case 'x':
|
||||
|
@ -861,7 +861,7 @@ test_modifiers (void)
|
||||
TEST_PRINTF_DATE (2009, 1, 21, "%-d", "21");
|
||||
TEST_PRINTF_DATE (2009, 1, 21, "%0d", "21");
|
||||
|
||||
TEST_PRINTF_DATE (2009, 1, 1, "%e", "1");
|
||||
TEST_PRINTF_DATE (2009, 1, 1, "%e", " 1");
|
||||
TEST_PRINTF_DATE (2009, 1, 1, "%_e", " 1");
|
||||
TEST_PRINTF_DATE (2009, 1, 1, "%-e", "1");
|
||||
TEST_PRINTF_DATE (2009, 1, 1, "%0e", "01");
|
||||
|
Loading…
Reference in New Issue
Block a user