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 344314 - 'Date Range' should include end date
'Date Range' should include end date
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: Browsing
CVS
Other Linux
: Normal minor
: ---
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-08 17:47 UTC by Stephane Delcroix
Modified: 2006-07-20 20:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
2 lines to fix it (1.71 KB, patch)
2006-06-09 09:30 UTC, Stephane Delcroix
reviewed Details | Review
new version (2.32 KB, patch)
2006-07-20 08:53 UTC, Stephane Delcroix
committed Details | Review

Description Stephane Delcroix 2006-06-08 17:47:28 UTC
Just added some pictures of today. Then setting a date range 06/01/2006 to 06/08/2006(today). But the pictures of today were not displayed at all.

Need to add tomorrow in the range to view the pictures of today...

I guess it's only replacing a < by a <= or adding 1day to the range
Comment 1 Bengt Thuree 2006-06-08 23:31:28 UTC
Looks like it.

In PhotoStore.cs the following code appears twice
  query_builder.Append (String.Format 
     ("AND photos.time >= {0} AND photos.time < {1} ",
     DbUtils.UnixTimeFromDateTime (range.Start), 
     DbUtils.UnixTimeFromDateTime (range.End)));
Comment 2 Stephane Delcroix 2006-06-09 09:30:13 UTC
Created attachment 67027 [details] [review]
2 lines to fix it

The Gnome.DateEdit widget (undocumented on the mono website) return the very first moment of the day.
So, I fixed the query with phototime < endrange+1day
Comment 3 Larry Ewing 2006-07-19 19:54:31 UTC
Shouldn't we be adjusting the the values when we get it from the widgets rather than changing it in the query logic?
Comment 4 Stephane Delcroix 2006-07-20 08:53:32 UTC
Created attachment 69233 [details] [review]
new version

Larry, I totally agree with you.

This one will add 23:59:59 to the endtime of the range, and change the query_builder to include ( <= ) the end of the range.

When converted back to the DateEdit widget, the time is changed back also to 0:0:0. so, it's ok.

I still have a doubt about something:
Imagine you have a quick shooter camera (Santa, bring me a D200 for Xmas, please) and you shoot in burst at the new years eve. Will those 5 pictures shooted AFTER 2006/12/31 23:59:59 be included in the range ???
My feeling is 'YES', because in the db, the time is stored as unix timestamp, with the 'second' as precision...
Comment 5 Larry Ewing 2006-07-20 20:26:41 UTC
Thanks for the quick turnaround.  Yeah I think they would