[goffice] Fix date format on Windows. [#655573]



commit 16860af1ca4e42ed451e04cda763a4a337f0f316
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon Aug 8 11:52:50 2011 -0600

     Fix date format on Windows. [#655573]
    
    2011-08-08  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* goffice/utils/go-locale.c (go_locale_month_before_day): in MSWindows
    	also consider where the year is.

 ChangeLog                 |    5 +++++
 NEWS                      |    1 +
 goffice/utils/go-locale.c |    8 ++++++--
 3 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f440217..0cc5332 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-08-08  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* goffice/utils/go-locale.c (go_locale_month_before_day): in MSWindows
+	also consider where the year is.
+
+2011-08-08  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* goffice/utils/go-format.c (go_format_execute): n digits means atmast
 	10^n -1
 	(go_format_generate_scientific_str): use number of exponent digits
diff --git a/NEWS b/NEWS
index d2b06eb..38af395 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ Andreas:
 	* Fix output of scientific number formats with EE to ODF.
 	* Fix interpretation of marked-up scientific number format. [#656056]
 	* Fix fraction rendering for unspecified denominators. [#656043]
+	* Fix date format on Windows. [#655573]
 
 Jean:
 	* Port to gtk+-3.0.
diff --git a/goffice/utils/go-locale.c b/goffice/utils/go-locale.c
index 327689c..ad58b42 100644
--- a/goffice/utils/go-locale.c
+++ b/goffice/utils/go-locale.c
@@ -415,8 +415,12 @@ go_locale_month_before_day (void)
 		{
 			TCHAR str[2];
 			GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_IDATE, str, 2);
-			month_first = str[0] != L'1';
-			/* FIXME: Figure out if year comes first.  */
+			if (str[0] == L'1')
+				month_first = 0;
+			else if (str[0] == L'2')
+				month_first = 2;
+			else
+				month_first = 1;
 		}
 
 #elif defined(HAVE_LANGINFO_H)



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