Make tasks in the multiweek and month views show up even if their start date is earlier than the start of the view (bug 335643), patch by Thomas Benisch <thomas.benisch@sun.com>, r=dmose

This commit is contained in:
dmose%mozilla.org 2006-05-31 20:32:02 +00:00
Родитель 997bc7e12b
Коммит b398b6a690
1 изменённых файлов: 4 добавлений и 7 удалений

Просмотреть файл

@ -720,9 +720,8 @@ calStorageCalendar.prototype = {
// to fall within the range // to fall within the range
sp = this.mSelectTodosByRange.params; sp = this.mSelectTodosByRange.params;
sp.cal_id = this.mCalId; sp.cal_id = this.mCalId;
sp.range_start = startTime;
sp.range_end = endTime; sp.range_end = endTime;
sp.offset = aRangeStart ? aRangeStart.timezoneOffset * USECS_PER_SECOND : 0; sp.end_offset = aRangeEnd ? aRangeEnd.timezoneOffset * USECS_PER_SECOND : 0;
while (this.mSelectTodosByRange.step()) { while (this.mSelectTodosByRange.step()) {
var row = this.mSelectTodosByRange.row; var row = this.mSelectTodosByRange.row;
@ -1071,16 +1070,14 @@ calStorageCalendar.prototype = {
" AND cal_id = :cal_id AND recurrence_id IS NULL" " AND cal_id = :cal_id AND recurrence_id IS NULL"
); );
var floatingTodoEntry = "todo_entry_tz = 'floating' AND todo_entry - :offset" var floatingTodoEntry = "todo_entry_tz = 'floating' AND todo_entry"
var nonFloatingTodoEntry = "todo_entry_tz != 'floating' AND todo_entry" var nonFloatingTodoEntry = "todo_entry_tz != 'floating' AND todo_entry"
this.mSelectTodosByRange = createStatement( this.mSelectTodosByRange = createStatement(
this.mDB, this.mDB,
"SELECT * FROM cal_todos " + "SELECT * FROM cal_todos " +
"WHERE " + "WHERE " +
" (((("+floatingTodoEntry+" >= :range_start) OR " + " ((("+floatingTodoEntry+" < :range_end + :end_offset) OR " +
" ("+nonFloatingTodoEntry+" >= :range_start)) AND " + " ("+nonFloatingTodoEntry+" < :range_end)) " +
" (("+floatingTodoEntry+" < :range_end) OR " +
" ("+nonFloatingTodoEntry+" < :range_end))) " +
" OR (todo_entry IS NULL)) " + " OR (todo_entry IS NULL)) " +
" AND cal_id = :cal_id AND recurrence_id IS NULL" " AND cal_id = :cal_id AND recurrence_id IS NULL"
); );