GNOME Bugzilla – Bug 344314
'Date Range' should include end date
Last modified: 2006-07-20 20:26:41 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
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)));
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
Shouldn't we be adjusting the the values when we get it from the widgets rather than changing it in the query logic?
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...
Thanks for the quick turnaround. Yeah I think they would