Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 230186 - GnomeDateEdit problems
Summary: GnomeDateEdit problems
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-libs
Version: 6
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Paul Howarth
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2007-02-27 10:15 UTC by Zoltan Boszormenyi
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 1.4.2-5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-03-11 11:41:43 UTC

Attachments (Terms of Use)
Test case for datetime problem (deleted)
2007-02-27 10:15 UTC, Zoltan Boszormenyi
no flags Details
GNOME 2 testcase (deleted)
2007-02-27 10:47 UTC, Zoltan Boszormenyi
no flags Details
Fixes for GnomeDateEdit (deleted)
2007-02-27 12:08 UTC, Zoltan Boszormenyi
no flags Details | Diff
GnomeDateEdit final fix (deleted)
2007-02-27 12:28 UTC, Zoltan Boszormenyi
no flags Details | Diff

Description Zoltan Boszormenyi 2007-02-27 10:15:51 UTC
Description of problem:

In GNOME-1.x applications recompiled for FC6, I observed some problems
with GnomeDateEdit widgets.

1. The time entry contains bogus time separator, a "." instead
of a ":". As a consequence, certain buggy behaviour is observed.
- Setting the date first (either from the dropdown calendar or manually)
  and then the time from the dropdown menu modifies the previously set
  date string.
- Using gnome_date_edit_get_date() on the widget gives bad
  time_t value, e.g. the bad separator stops interpreting
  the time string. Altering the time string manually so
  it reads correctly with ":" separators, make this problem
  go away.

2. Clearing both the date and time entries and then using
gnome_date_edit_get_date() gives back the current date (+ 0:00:00)
instead of (time_t)-1. It worked on earlier systems, Red Hat 6.x,
Red Hat 7.x, RH9 and up to FC5 were tested.

Version-Release number of selected component (if applicable):

$ rpm -q gnome-libs

How reproducible:


Steps to Reproduce:
1. Compile and the attached test case (created with glade-0.6.4) on FC6 with
   gnome-libs-1.x installed.
2. Run it.
Actual results:

Described above.

Expected results:

The time string should contain ":" time separator both
in the dropdown menu and in the time entry of the GnomeDateEdit.

Additional info:

Comment 1 Zoltan Boszormenyi 2007-02-27 10:15:51 UTC
Created attachment 148851 [details]
Test case for datetime problem

Comment 2 Zoltan Boszormenyi 2007-02-27 10:47:51 UTC
Created attachment 148853 [details]
GNOME 2 testcase

The attached GNOME 2 testcase works as expected from my description,
e.g. empty date entry gives (time_t)-1 which translates to 1899-12-31

I also discovered that the command line "date" gives the time separated
also with dots. The GNOME 2 test case work despite of this. The GNOME 1.x
bug may be a bad interaction between the tzdata(?) or the info set by LANG.
It is hu_HU.UTF-8 in my case, BTW.

Comment 3 Paul Howarth 2007-02-27 11:11:25 UTC
Given that upstream isn't going to fix this, it's going to be down to you and me
to either find a fix for this (e.g. from another distro) or write one ourselves...

Comment 4 Zoltan Boszormenyi 2007-02-27 12:08:36 UTC
Created attachment 148858 [details]
Fixes for GnomeDateEdit

I came up with the attached patch that fixes the problems
I described earlier.
- invalid date entry now returns (time_t)-1
- the time dropdown contains the same entries as GnomeDateEdit on GNOME 2,
  i.e. hardcoded %H:%M. The selected time string was always copied to 
  the time entry, which (having an incorrect format) caused problems.
- the time entry contains %H:%M:%S after doing gnome_date_edit_set_time()
  and on initial gtk_widget_show()

Comment 5 Zoltan Boszormenyi 2007-02-27 12:14:56 UTC
The fix may be a bit simpler, though. Option "%X" in strftime() calls
can simply be substituted with "%R" and "%T" where appropriate.
Just checked with these commands:
$ date "+%X"
$ date "+%T"
$ date "+%R"

Comment 6 Zoltan Boszormenyi 2007-02-27 12:28:09 UTC
Created attachment 148859 [details]
GnomeDateEdit final fix

This fix implements the modified strftime() options,
works as good as the hardcoded sprintf().

Comment 7 Paul Howarth 2007-03-11 11:41:43 UTC
gnome-libs-1.4.2-5 contains your patch from Comment #6 and has been released for
FC-6 and Rawhide.

Note You need to log in before you can comment on or make changes to this bug.