Fixed bug 128828, calendar events were not in the right order.

This commit is contained in:
mikep%oeone.com 2002-03-05 14:18:27 +00:00
Родитель e957add476
Коммит 0f493857d0
2 изменённых файлов: 38 добавлений и 4 удалений

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

@ -131,14 +131,14 @@ function calendarInit()
// get the Ical Library
gICalLib = gEventSource.getICalLib();
// set up the unifinder
prepareCalendarUnifinder( gEventSource );
// set up the CalendarWindow instance
gCalendarWindow = new CalendarWindow( gEventSource );
// set up the unifinder
prepareCalendarUnifinder( gEventSource );
// show the month view, with today selected
gCalendarWindow.switchToMonthView( );

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

@ -236,6 +236,8 @@ CalendarEventDataSource.prototype.search = function( searchText, fieldName )
}
}
searchEventTable.sort( this.orderRawEventsByDate );
return searchEventTable;
}
@ -404,8 +406,11 @@ CalendarEventDataSource.prototype.getAllEvents = function( )
while( eventList.hasMoreElements() )
{
var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEvent);
eventArray[ eventArray.length ] = tmpevent;
}
eventArray.sort( this.orderRawEventsByDate );
return eventArray;
}
@ -468,6 +473,35 @@ CalendarEventDataSource.prototype.openNewEventDialog = function( onOK, startTime
calendar.openDialog("caNewEvent", "chrome://calendar/content/ca-event-dialog.xul", false, args );
}
/** PACKAGE STATIC
* CalendarEvent orderEventsByDate.
*
* NOTES
* Used to sort table by date
*/
CalendarEventDataSource.prototype.orderEventsByDate = function( eventA, eventB )
{
/*
return( eventA.event.start.getTime() - eventB.event.start.getTime() );
*/
return( eventA.displayDate.getTime() - eventB.displayDate.getTime() );
}
/** PACKAGE STATIC
* CalendarEvent orderRawEventsByDate.
*
* NOTES
* Used to sort table by date
*/
CalendarEventDataSource.prototype.orderRawEventsByDate = function( eventA, eventB )
{
return( eventA.start.getTime() - eventB.start.getTime() );
}
/******************************************************************************************************
******************************************************************************************************