mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
datetime: Rename g_date_time_printf() to g_date_time_format()
The function does not use any printf() modifiers, so using printf() is a misnomer. Prior art: strftime, g_ascii_formatd https://bugzilla.gnome.org/show_bug.cgi?id=50076
This commit is contained in:
parent
4bac6613cf
commit
3e9fb52214
@ -121,10 +121,10 @@
|
||||
#define MONTH_FULL(d) (get_month_name (g_date_time_get_month (datetime)))
|
||||
|
||||
/* Translators: this is the preferred format for expressing the date */
|
||||
#define GET_PREFERRED_DATE(d) (g_date_time_printf ((d), C_("GDateTime", "%m/%d/%y")))
|
||||
#define GET_PREFERRED_DATE(d) (g_date_time_format ((d), C_("GDateTime", "%m/%d/%y")))
|
||||
|
||||
/* Translators: this is the preferred format for expressing the time */
|
||||
#define GET_PREFERRED_TIME(d) (g_date_time_printf ((d), C_("GDateTime", "%H:%M:%S")))
|
||||
#define GET_PREFERRED_TIME(d) (g_date_time_format ((d), C_("GDateTime", "%H:%M:%S")))
|
||||
|
||||
#define SECS_PER_MINUTE (60)
|
||||
#define SECS_PER_HOUR (60 * SECS_PER_MINUTE)
|
||||
@ -2237,7 +2237,7 @@ g_date_time_new_now (void)
|
||||
}
|
||||
|
||||
/**
|
||||
* g_date_time_printf:
|
||||
* g_date_time_format:
|
||||
* @datetime: A #GDateTime
|
||||
* @format: a valid UTF-8 string, containing the format for the #GDateTime
|
||||
*
|
||||
@ -2293,7 +2293,7 @@ g_date_time_new_now (void)
|
||||
* Since: 2.26
|
||||
*/
|
||||
gchar *
|
||||
g_date_time_printf (const GDateTime *datetime,
|
||||
g_date_time_format (const GDateTime *datetime,
|
||||
const gchar *format)
|
||||
{
|
||||
GString *outstr;
|
||||
|
@ -192,7 +192,7 @@ gint64 g_date_time_to_epoch (const GDateTime *datet
|
||||
void g_date_time_to_timeval (const GDateTime *datetime,
|
||||
GTimeVal *tv);
|
||||
GDateTime * g_date_time_to_utc (const GDateTime *datetime);
|
||||
gchar * g_date_time_printf (const GDateTime *datetime,
|
||||
gchar * g_date_time_format (const GDateTime *datetime,
|
||||
const gchar *format) G_GNUC_MALLOC;
|
||||
|
||||
GTimeZone * g_time_zone_new (gint offset,
|
||||
|
@ -899,21 +899,21 @@ test_GDateTime_printf (void)
|
||||
|
||||
#define TEST_PRINTF(f,o) G_STMT_START { \
|
||||
GDateTime *__dt = g_date_time_new_from_date (2009, 10, 24); \
|
||||
gchar *__p = g_date_time_printf (__dt, (f)); \
|
||||
gchar *__p = g_date_time_format (__dt, (f)); \
|
||||
g_assert_cmpstr (__p, ==, (o)); \
|
||||
g_date_time_unref (__dt); \
|
||||
g_free (__p); } G_STMT_END
|
||||
|
||||
#define TEST_PRINTF_DATE(y,m,d,f,o) G_STMT_START { \
|
||||
GDateTime *dt = g_date_time_new_from_date ((y), (m), (d)); \
|
||||
gchar *p = g_date_time_printf (dt, (f)); \
|
||||
gchar *p = g_date_time_format (dt, (f)); \
|
||||
g_assert_cmpstr (p, ==, (o)); \
|
||||
g_date_time_unref (dt); \
|
||||
g_free (p); } G_STMT_END
|
||||
|
||||
#define TEST_PRINTF_TIME(h,m,s,f,o) G_STMT_START { \
|
||||
GDateTime *dt = g_date_time_new_full (2009, 10, 24, (h), (m), (s), NULL); \
|
||||
gchar *p = g_date_time_printf (dt, (f)); \
|
||||
gchar *p = g_date_time_format (dt, (f)); \
|
||||
g_assert_cmpstr (p, ==, (o)); \
|
||||
g_date_time_unref (dt); \
|
||||
g_free (p); } G_STMT_END
|
||||
|
Loading…
Reference in New Issue
Block a user