From: Greg W. <gr...@gr...> - 2002-11-22 18:42:25
|
I just started thinking about sorting the todos, so that high priority todos show up at the top (and maybe those with pressing due dates), but am not sure how best to go about it. I figure that they should be sorted first by priority, but I tend to think that low priority items should go below those without any priority (is this sort of thing discussed in the iCalendar standard somewhere? Could someone point me in the right direction?). I think just a basic sort would put those without values last. I would then tend to sort things by due date within any given priority level. Does that seem reasonable? Also, I'm not sure about how this sort of sorting would be best accomplished, technically. A sort() or ksort() wouldn't work, because the sort happens many levels above the level of the things being compared. A comment on php.net suggested that usort() would be the best thing for this purpose. Looking at the usort() documentation, it actually looks like it should be fairly easy to write a function that does this sort of nontrivial comparison. I just wanted to see if anyone had any thoughts on this before I just went ahead with it. Greg --- gr...@gr... http://www.gregwestin.com/ Contact info: http://www.gregwestin.com/contact.php |