[glib] g_date_time_format: rip out non-working %W format
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] g_date_time_format: rip out non-working %W format
- Date: Sat, 3 Sep 2011 01:22:01 +0000 (UTC)
commit 1b04f0d9730e94c80db35f3dbd21cdfbb7e2c9da
Author: Ryan Lortie <desrt desrt ca>
Date: Fri Sep 2 20:54:51 2011 -0400
g_date_time_format: rip out non-working %W format
Our implementation of %W is incorrect. Nobody should want to use this
format anyway and the implementation is non-trivial, so rip it out
rather than fixing it.
Remove the testcase for %W as well.
glib/gdatetime.c | 9 ---------
glib/tests/gdatetime.c | 1 -
2 files changed, 0 insertions(+), 10 deletions(-)
---
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index 76bbd62..4a20310 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -2302,11 +2302,6 @@ get_numeric_format (gchar *fmt,
* This is not the ISO 8601 standard format -- use %%u instead.
* </simpara></listitem></varlistentry>
* <varlistentry><term>
- * <literal>%%W</literal>:
- * </term><listitem><simpara>
- * the week number of the current year as a decimal number
- * </simpara></listitem></varlistentry>
- * <varlistentry><term>
* <literal>%%x</literal>:
* </term><listitem><simpara>
* the preferred date representation for the current locale without
@@ -2585,10 +2580,6 @@ g_date_time_format (GDateTime *datetime,
g_string_append_printf (outstr, fmt, day_of_week);
}
break;
- case 'W':
- 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':
{
tmp = g_date_time_format (datetime, PREFERRED_DATE_FMT);
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index b22266b..4140251 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -834,7 +834,6 @@ GDateTime *__dt = g_date_time_new_local (2009, 10, 24, 0, 0, 0);\
//TEST_PRINTF ("%s", t_str);
TEST_PRINTF ("%S", "00");
TEST_PRINTF ("%t", " ");
- TEST_PRINTF ("%W", "42");
TEST_PRINTF ("%u", "6");
TEST_PRINTF ("%x", "10/24/09");
TEST_PRINTF ("%X", "00:00:00");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]