[gnumeric] GUI: handle pre-1900 dates.



commit c629abfc01fac43f13539d8aac1805e1a477baa7
Author: Morten Welinder <terra gnome org>
Date:   Fri Oct 23 10:19:24 2009 -0400

    GUI: handle pre-1900 dates.

 ChangeLog          |    4 ++++
 src/number-match.c |    3 ++-
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 66829f3..631c13c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-10-23  Morten Welinder  <terra gnome org>
+
+	* src/number-match.c (handle_year): Handle pre-1900 dates.
+
 2009-10-22  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* configure.in: add fn-christian-date plugin
diff --git a/src/number-match.c b/src/number-match.c
index ffa442d..9bfbdbf 100644
--- a/src/number-match.c
+++ b/src/number-match.c
@@ -25,6 +25,7 @@
 #include "value.h"
 #include "mathfunc.h"
 #include "numbers.h"
+#include "gnm-datetime.h"
 #include <goffice/goffice.h>
 
 #include <stdio.h>
@@ -386,7 +387,7 @@ handle_year (char const *text, GORegmatch const *pm)
 		return 2000 + y;
 	else if (y <= 99)
 		return 1900 + y;
-	else if (y <= 1899)
+	else if (y < (gnm_datetime_allow_negative () ? 1582 : 1900))
 		return -1;
 	else
 		return y;



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