mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
g_date_time_format: small fixups
Add missing 'break;' from the case: block for %c. Reorder the cases so that %F comes before %g/%G and %n comes in its correct alphabetical order.
This commit is contained in:
parent
65fe8b73c5
commit
4b35f12552
@ -2441,6 +2441,7 @@ g_date_time_format (GDateTime *datetime,
|
||||
case 'C':
|
||||
get_numeric_format (fmt, sizeof(fmt), alt_digits, pad_set ? pad : '0', 2);
|
||||
g_string_append_printf (outstr, fmt, g_date_time_get_year (datetime) / 100);
|
||||
break;
|
||||
case 'd':
|
||||
get_numeric_format (fmt, sizeof(fmt), alt_digits, pad_set ? pad : '0', 2);
|
||||
g_string_append_printf (outstr, fmt, g_date_time_get_day_of_month (datetime));
|
||||
@ -2449,18 +2450,18 @@ g_date_time_format (GDateTime *datetime,
|
||||
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':
|
||||
g_string_append_printf (outstr, "%02d", g_date_time_get_week_numbering_year (datetime) % 100);
|
||||
break;
|
||||
case 'G':
|
||||
g_string_append_printf (outstr, "%d", g_date_time_get_week_numbering_year (datetime));
|
||||
break;
|
||||
case 'F':
|
||||
g_string_append_printf (outstr, "%d-%02d-%02d",
|
||||
g_date_time_get_year (datetime),
|
||||
g_date_time_get_month (datetime),
|
||||
g_date_time_get_day_of_month (datetime));
|
||||
break;
|
||||
case 'g':
|
||||
g_string_append_printf (outstr, "%02d", g_date_time_get_week_numbering_year (datetime) % 100);
|
||||
break;
|
||||
case 'G':
|
||||
g_string_append_printf (outstr, "%d", g_date_time_get_week_numbering_year (datetime));
|
||||
break;
|
||||
case 'h':
|
||||
g_string_append (outstr, MONTH_ABBR (datetime));
|
||||
break;
|
||||
@ -2494,6 +2495,9 @@ g_date_time_format (GDateTime *datetime,
|
||||
g_string_append_printf (outstr, fmt, hour);
|
||||
}
|
||||
break;
|
||||
case 'n':
|
||||
g_string_append_c (outstr, '\n');
|
||||
break;
|
||||
case 'm':
|
||||
get_numeric_format (fmt, sizeof(fmt), alt_digits, pad_set ? pad : '0', 2);
|
||||
g_string_append_printf (outstr, fmt, g_date_time_get_month (datetime));
|
||||
@ -2612,9 +2616,6 @@ g_date_time_format (GDateTime *datetime,
|
||||
case '%':
|
||||
g_string_append_c (outstr, '%');
|
||||
break;
|
||||
case 'n':
|
||||
g_string_append_c (outstr, '\n');
|
||||
break;
|
||||
case '-':
|
||||
pad_set = TRUE;
|
||||
pad = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user