After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 599365 - Unexpected date handling
Unexpected date handling
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: GUI
git master
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2009-10-23 01:05 UTC by Andreas J. Guelzow
Modified: 2009-10-23 14:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas J. Guelzow 2009-10-23 01:05:23 UTC
Enter 
July 1, 1867
into A1,

I would have expected to see anything but ############## since the hashmarks remain even if the cell is made as wide as the screen.
Comment 1 Morten Welinder 2009-10-23 02:01:16 UTC
##### here means invalid date.  Not sure why that is, though.
Comment 2 Morten Welinder 2009-10-23 02:03:04 UTC
static int
handle_year (char const *text, GORegmatch const *pm)
{
	int y;

	if (pm->rm_so == pm->rm_eo)
		return current_year ();

	y = handle_int (text, pm, 0, 9999);

	if (y < 0)
		return -1;
	else if (y <= 29)
		return 2000 + y;
	else if (y <= 99)
		return 1900 + y;
	else if (y <= 1899)
		return -1;
	else
		return y;
}
Comment 3 Andreas J. Guelzow 2009-10-23 03:29:09 UTC
some related (?) observations:

=eastersunday(1867)  shows as a nice date (probably even the correct one)
=date(1867,7,1)      shows as July 1, 3767  (I guess Canadian confederation is truly in the future)
typing any text that should be read as a date shows ######################
Comment 4 Morten Welinder 2009-10-23 13:48:35 UTC
> =date(1867,7,1)      shows as July 1, 3767

Excel compatibility!  That made a lot more sense before we started
supporting pre-1900 dates.

	if (year < 1900) /* 1900, not 100.  Ick!  */
		year += 1900;

I'll move the cut-off down to 1000.  (We do not support dates before 15xx
anyway.)
Comment 5 Morten Welinder 2009-10-23 13:53:54 UTC
DATE fixed.
Comment 6 Morten Welinder 2009-10-23 14:20:10 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.


(Bugzilla buttons are back!)