rem: var Today = new Date();  var StartDate = new Date( Today.getFullYear(), Today.getMonth(), Today.getDate(), 0, 0, 0 );  switch( event.currentTarget.parentNode.selectedItem.value ) { case "all": gEventSource.onlyFutureEvents = false; eventTable = gEventSource.getCurrentEvents(); break;  case "today": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1 ); eventTable = gEventSource.getEventsForRange( StartDate, EndDate ); break; case "week": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 8 ) ); eventTable = gEventSource.getEventsForRange( StartDate, EndDate ); break; case "2weeks": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 15 ) ); eventTable = gEventSource.getEventsForRange( StartDate, EndDate ); break; case "month": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 32 ) ); eventTable = gEventSource.getEventsForRange( StartDate, EndDate ); break; case "future": gEventSource.onlyFutureEvents = true; eventTable = gEventSource.getCurrentEvents(); break; default: alert( "there's no case for ".event.currentTarget.selectedItem.value ); break; }  refreshEventTree( eventTable ); 
add: refreshEventTree( false ); 
context: function unifinderDoFilterEvents( event ){   var Today = new Date();   //do this to allow all day events to show up all day long   var StartDate = new Date( Today.getFullYear(), Today.getMonth(), Today.getDate(), 0, 0, 0 );      switch( event.currentTarget.parentNode.selectedItem.value )   {      case "all":         gEventSource.onlyFutureEvents = false;         eventTable = gEventSource.getCurrentEvents();         break;         case "today":         var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1 );         eventTable = gEventSource.getEventsForRange( StartDate, EndDate );         break;      case "week":         var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 8 ) );         eventTable = gEventSource.getEventsForRange( StartDate, EndDate );         break;      case "2weeks":         var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 15 ) );         eventTable = gEventSource.getEventsForRange( StartDate, EndDate );         break;      case "month":         var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 32 ) );         eventTable = gEventSource.getEventsForRange( StartDate, EndDate );         break;      case "future":         gEventSource.onlyFutureEvents = true;         eventTable = gEventSource.getCurrentEvents();         break;      default:          alert( "there's no case for ".event.currentTarget.selectedItem.value );         break;   }   refreshEventTree( eventTable );   /* The following isn't exactly right. It should actually reload after the next event happens. */   // get the current time   var now = new Date();      var tomorrow = new Date( now.getFullYear(), now.getMonth(), ( now.getDate() + 1 ) );      var milliSecsTillTomorrow = tomorrow.getTime() - now.getTime();      setTimeout( "refreshEventTree( eventTable )", milliSecsTillTomorrow );}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/f6463a60e7134b5a8637531c92f1cbc7586a12b9/unifinder.js/clean/calendar/resources/content/unifinder.js