mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 17:56:17 +01:00
g_date_time_format: support %D
%D represents the date in mm/dd/yy format. https://bugzilla.gnome.org/show_bug.cgi?id=658061
This commit is contained in:
parent
4b35f12552
commit
46ce790772
@ -2166,6 +2166,10 @@ get_numeric_format (gchar *fmt,
|
||||
* </term><listitem><simpara>
|
||||
* the day of the month as a decimal number (range 01 to 31)
|
||||
* </simpara></listitem></varlistentry>
|
||||
* <literal>%%D</literal>:
|
||||
* </term><listitem><simpara>
|
||||
* equivalent to <literal>%%m/%%d/%%y</literal>
|
||||
* </simpara></listitem></varlistentry>
|
||||
* <varlistentry><term>
|
||||
* <literal>%%e</literal>:
|
||||
* </term><listitem><simpara>
|
||||
@ -2446,6 +2450,12 @@ g_date_time_format (GDateTime *datetime,
|
||||
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));
|
||||
break;
|
||||
case 'D':
|
||||
g_string_append_printf (outstr, "%02d/%02d/%02d",
|
||||
g_date_time_get_month (datetime),
|
||||
g_date_time_get_day_of_month (datetime),
|
||||
g_date_time_get_year (datetime));
|
||||
break;
|
||||
case 'e':
|
||||
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));
|
||||
|
Loading…
Reference in New Issue
Block a user