https://www.chiliproject.org/2011-06-30T15:46:08+02:00ChiliProjectChiliProject - Feature #499: Due date sort order should sort issues with no due date to the end of the listhttps://www.chiliproject.org/issues/499?journal_id=102002011-06-30T15:46:08+02:00Maccabee Levinelevinem@uwosh.edu
<ul><li><strong>Start date</strong> set to <i>2011-06-30</i></li><li><strong>Estimated time</strong> deleted ()</li><li><strong>Priority</strong> changed from <i>Normal</i> to <i>Normal</i></li><li><strong>Project</strong> set to <i>ChiliProject</i></li><li><strong>Target version</strong> set to <i>2.1.0</i></li><li><strong>Assignee</strong> set to <i>Felix Schäfer</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>0</i></li><li><strong>Subject</strong> set to <i>Due date sort order should sort issues with no due date to the end of the list</i></li><li><strong>Category</strong> set to <i>Issue tracking</i></li><li><strong>Tracker</strong> set to <i>Feature</i></li><li><strong>Due date</strong> deleted ()</li><li><strong>Subproject of</strong> deleted ()</li><li><strong>Description</strong> set to <i>Sorting by due date (ascending or descending) should place items with no due ...</i> <a href="/journals/10200/diff/description" class="lightbox-ajax">More</a></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul> ChiliProject - Feature #499: Due date sort order should sort issues with no due date to the end of the listhttps://www.chiliproject.org/issues/499?journal_id=22042011-07-01T16:44:02+02:00Eric Davis
<ul></ul><p>To be clear, like this?</p>
<ul>
<li>2011-07-01</li>
<li>2011-07-02</li>
<li>2011-07-03</li>
<li>(empty)</li>
<li>(empty)</li>
</ul> ChiliProject - Feature #499: Due date sort order should sort issues with no due date to the end of the listhttps://www.chiliproject.org/issues/499?journal_id=22082011-07-01T17:26:54+02:00Maccabee Levinelevinem@uwosh.edu
<ul></ul><p>Yup. I just half-solved it locally with this one-line change in query.rb. (It's not perfect because it keeps the empty values at the end even if you sort in the opposite direction. But it was good enough for my use.)</p>
<p>#QueryColumn.new(:due_date, :sortable => "#{Issue.table_name}.due_date"),<br />QueryColumn.new(:due_date, :sortable => "case when #{Issue.table_name}.due_date is NULL then 1 else 0 end, #{Issue.table_name}.due_date"),</p> ChiliProject - Feature #499: Due date sort order should sort issues with no due date to the end of the listhttps://www.chiliproject.org/issues/499?journal_id=22712011-07-08T20:28:16+02:00Felix Schäferfelix+chili@oh14.de
<ul><li><strong>Target version</strong> set to <i>2.1.0</i></li><li><strong>Assignee</strong> set to <i>Felix Schäfer</i></li><li><strong>(deleted custom field)</strong> set to <i>master</i></li></ul><p>The SQL looks sound to me, let me check locally, if everything is OK I'll push it.</p>
<p>Should this be made the default for all date columns? (i.e. a <code>NULL</code> date is always far in the future and not far in the past?)</p> ChiliProject - Feature #499: Due date sort order should sort issues with no due date to the end of the listhttps://www.chiliproject.org/issues/499?journal_id=22732011-07-08T20:59:27+02:00Eric Davis
<ul></ul><p>Felix Schäfer wrote:</p>
<blockquote>
<p>Should this be made the default for all date columns? (i.e. a <code>NULL</code> date is always far in the future and not far in the past?)</p>
</blockquote>
<p>I don't think we can make a "default for all dates" statement from this. In this case a null due date can be interpreted as "no due date" which should be "far into the future". Other dates could be interpreted differently.</p> ChiliProject - Feature #499: Due date sort order should sort issues with no due date to the end of the listhttps://www.chiliproject.org/issues/499?journal_id=22752011-07-08T21:25:08+02:00Felix Schäferfelix+chili@oh14.de
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Ok, so it needed to be formatted a little differently for ChiliProject because the way you (Maccabee) posted it, ChiliProject wouldn't pass the sort direction (ASC or DESC) to the <code>CASE</code> clause, resulting in issues with empty due dates always being at the end.</p>
<p>After having <a href="http://chat.chiliproject.org/log/irc.freenode.net/chiliproject/2011-07-08#i_2533635" class="external">discussed it</a> shortly with Eric on IRC (excerpt below), I applied the same treatment to the <code>start_date</code>.</p>
<pre>21:05 thegcat edavis10: null start_date, far future or far past?
21:13 edavis10 thegcat: hm... that would be "no start date" so it would be far future
21:13 thegcat edavis10: k, so same treatment
21:14 edavis10 yea, thats why I said it depends on the actual field
21:14 thegcat well, come to think of it
21:15 thegcat maybe a more common workflow is to say "empty" is immediate, only those with a date are in the future
21:15 edavis10 thegcat: for start date? I'd say "Today" would be immediate.
21:16 thegcat mmh, ok</pre> ChiliProject - Feature #499: Due date sort order should sort issues with no due date to the end of the listhttps://www.chiliproject.org/issues/499?journal_id=23302011-07-18T17:59:04+02:00Maccabee Levinelevinem@uwosh.edu
<ul></ul><p>This makes sense to me.</p>