[glib] Expand the g_date_time_format documentation



commit e15ecab0486aa851dcc15e6e4023354a4b8b481f
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu May 5 13:40:51 2011 -0400

    Expand the g_date_time_format documentation
    
    Mention strftime, and explain supported modifiers.

 glib/gdatetime.c |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index 8ff2a4a..ead4d30 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -2088,6 +2088,12 @@ get_numeric_format (gchar    *fmt,
  *
  * Creates a newly allocated string representing the requested @format.
  *
+ * The format strings understood by this function are a subset of the
+ * strftime() format language. In contrast to strftime(), this function
+ * always produces a UTF-8 string, regardless of the current locale.
+ * Note that the rendering of many formats is locale-dependent and may
+ * not match the strftime() output exactly.
+ *
  * The following format specifiers are supported:
  *
  * <variablelist>
@@ -2264,6 +2270,41 @@ get_numeric_format (gchar    *fmt,
  *  </simpara></listitem></varlistentry>
  * </variablelist>
  *
+ * Some conversion specifications can be modified by preceding the
+ * conversion specifier by one or more modifier characters. The
+ * following modifiers are supported for many of the numeric
+ * conversions:
+ * <variablelist>
+ *   <varlistentry>
+ *     <term>O</term>
+ *     <listitem>
+ *       Use alternative numeric symbols, if the current locale
+ *       supports those.
+ *     </listitem>
+ *   </varlistentry>
+ *   <varlistentry>
+ *     <term>_</term>
+ *     <listitem>
+ *       Pad a numeric result with spaces.
+ *       This overrides the default padding for the specifier.
+ *     </listitem>
+ *   </varlistentry>
+ *   <varlistentry>
+ *     <term>-</term>
+ *     <listitem>
+ *       Do not pad a numeric result.
+ *       This overrides the default padding for the specifier.
+ *     </listitem>
+ *   </varlistentry>
+ *   <varlistentry>
+ *     <term>0</term>
+ *     <listitem>
+ *       Pad a numeric result with zeros.
+ *       This overrides the default padding for the specifier.
+ *     </listitem>
+ *   </varlistentry>
+ * </variablelist>
+ *
  * Returns: a newly allocated string formatted to the requested format
  *          or %NULL in the case that there was an error.  The string
  *          should be freed with g_free().



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]