Commit eefe699a authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Use yyyy-m-d format for date entry when appropriate.

2007-11-06  Morten Welinder  <terra@gnome.org>

        * src/wbc-gtk-edit.c (wbcg_edit_start): Use yyyy-m-d format for
        date entry when appropriate.

        * src/gnm-format.c (gnm_format_month_before_day): Update return
        value like for go_format_month_before_day.


svn path=/trunk/; revision=16089
parent 9b687f4d
2007-11-06 Morten Welinder <terra@gnome.org>
* src/wbc-gtk-edit.c (wbcg_edit_start): Use yyyy-m-d format for
date entry when appropriate.
* src/gnm-format.c (gnm_format_month_before_day): Update return
value like for go_format_month_before_day.
2007-11-06 Andreas Guelzow <aguelzow@pyrshep.ca>
* src/print.c (PrintingInstance): add HFRenderInfo
......
......@@ -12,6 +12,7 @@ Jean
Morten:
* Make pdf exporter able to print specified sheets only.
* Make it possible to set page size for ssconvert's pdf exporter.
* Fix date entry problem with yyyy-mm-dd formats. [#494387]
--------------------------------------------------------------------------
Gnumeric 1.7.14
......
......@@ -141,7 +141,7 @@ AC_SUBST(GOFFICE_VERSION,$goffice_ver)
dnl *****************************
libspreadsheet_reqs="
$libgoffice >= 0.5.2
$libgoffice >= 0.5.3
libgsf-1 >= 1.14.6
libxml-2.0 >= 2.4.12
"
......
......@@ -250,7 +250,7 @@ gnm_format_is_time_for_value (GOFormat const *fmt,
return (go_format_get_family (fmt) == GO_FORMAT_TIME);
}
gboolean
int
gnm_format_month_before_day (GOFormat const *fmt,
GnmValue const *value)
{
......@@ -263,7 +263,7 @@ gnm_format_month_before_day (GOFormat const *fmt,
if (mbd < 0)
mbd = go_locale_month_before_day ();
return mbd != 0;
return mbd;
}
gboolean
......
......@@ -34,8 +34,8 @@ int gnm_format_is_date_for_value (GOFormat const *fmt,
int gnm_format_is_time_for_value (GOFormat const *fmt,
GnmValue const *value);
gboolean gnm_format_month_before_day (GOFormat const *fmt,
GnmValue const *value);
int gnm_format_month_before_day (GOFormat const *fmt,
GnmValue const *value);
gboolean gnm_format_has_hour (GOFormat const *fmt,
GnmValue const *value);
......
......@@ -1089,7 +1089,7 @@ format_match (char const *text, GOFormat *cur_fmt,
case GO_FORMAT_DATE: {
gboolean month_before_day =
gnm_format_month_before_day (cur_fmt, NULL);
gnm_format_month_before_day (cur_fmt, NULL) != 0;
v = format_match_datetime (text, date_conv,
month_before_day,
......@@ -1104,7 +1104,7 @@ format_match (char const *text, GOFormat *cur_fmt,
case GO_FORMAT_TIME: {
gboolean month_before_day =
gnm_format_month_before_day (cur_fmt, NULL);
gnm_format_month_before_day (cur_fmt, NULL) != 0;
gboolean prefer_hour =
gnm_format_has_hour (cur_fmt, NULL);
......@@ -1166,7 +1166,7 @@ format_match (char const *text, GOFormat *cur_fmt,
}
v = format_match_datetime (text, date_conv,
go_locale_month_before_day (),
go_locale_month_before_day () != 0,
TRUE,
FALSE);
if (v)
......
......@@ -882,12 +882,19 @@ wbcg_edit_start (WBCGtk *wbcg,
}
case GO_FORMAT_DATE: {
const char *ftxt;
GString *fstr;
GOFormat *new_fmt;
gboolean mbd = gnm_format_month_before_day
int mbd = gnm_format_month_before_day
(fmt, cell->value);
fstr = g_string_new (mbd ? "m/d/yyyy" : "d/m/yyyy");
switch (mbd) {
case 0: ftxt = "d/m/yyyy"; break;
default:
case 1: ftxt = "m/d/yyyy"; break;
case 2: ftxt = "yyyy-m-d"; break;
}
fstr = g_string_new (ftxt);
if (!close_to_int (f, 1e-6 / (24 * 60 * 60))) {
g_string_append_c (fstr, ' ');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment