From 646682771ca59d3ccb1ad8993dd049a18af85fec Mon Sep 17 00:00:00 2001 From: "sman%netscape.com" Date: Fri, 25 Sep 1998 17:07:58 +0000 Subject: [PATCH] use supplied date range rather than precalculated dates --- calendar/modules/core/inc/nsLayer.h | 4 ++-- calendar/modules/core/inc/nsLayerCollection.h | 4 ++-- calendar/modules/core/public/nsILayer.h | 4 ++-- calendar/modules/core/src/nsLayer.cpp | 9 +++++++-- calendar/modules/core/src/nsLayerCollection.cpp | 4 ++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/calendar/modules/core/inc/nsLayer.h b/calendar/modules/core/inc/nsLayer.h index 517682df889c..5c1e584533e7 100644 --- a/calendar/modules/core/inc/nsLayer.h +++ b/calendar/modules/core/inc/nsLayer.h @@ -54,8 +54,8 @@ public: NS_IMETHOD GetCal(NSCalendar*& aCal); NS_IMETHOD SetShell(nsCalendarShell* aShell) {mpShell = aShell; return NS_OK;} NS_IMETHOD FetchEventsByRange( - const DateTime* aStart, - const DateTime* aStop, + DateTime* aStart, + DateTime* aStop, JulianPtrArray* anArray ); private: diff --git a/calendar/modules/core/inc/nsLayerCollection.h b/calendar/modules/core/inc/nsLayerCollection.h index 75943883067f..7d96ed8b7c80 100644 --- a/calendar/modules/core/inc/nsLayerCollection.h +++ b/calendar/modules/core/inc/nsLayerCollection.h @@ -56,8 +56,8 @@ public: NS_IMETHOD SetCal(NSCalendar* aCal); NS_IMETHOD GetCal(NSCalendar*& aCal); NS_IMETHOD FetchEventsByRange( - const DateTime* aStart, - const DateTime* aStop, JulianPtrArray* aL + DateTime* aStart, + DateTime* aStop, JulianPtrArray* aL ); private: nsIVector * mLayers ; diff --git a/calendar/modules/core/public/nsILayer.h b/calendar/modules/core/public/nsILayer.h index 88e21865870b..144728c31b13 100644 --- a/calendar/modules/core/public/nsILayer.h +++ b/calendar/modules/core/public/nsILayer.h @@ -71,8 +71,8 @@ public: NS_IMETHOD SetCal(NSCalendar* aCal) = 0; NS_IMETHOD GetCal(NSCalendar*& aCal) = 0; NS_IMETHOD FetchEventsByRange( - const DateTime* aStart, - const DateTime* aStop, + DateTime* aStart, + DateTime* aStop, JulianPtrArray* anArray ) = 0; }; diff --git a/calendar/modules/core/src/nsLayer.cpp b/calendar/modules/core/src/nsLayer.cpp index f4cf2120dbc5..113c86412e61 100644 --- a/calendar/modules/core/src/nsLayer.cpp +++ b/calendar/modules/core/src/nsLayer.cpp @@ -211,8 +211,8 @@ static int giViewPropListCount = 10; * @return NS_OK on success. */ nsresult nsLayer::FetchEventsByRange( - const DateTime* aStart, - const DateTime* aStop, + DateTime* aStart, + DateTime* aStop, JulianPtrArray* anArray ) { @@ -258,11 +258,16 @@ nsresult nsLayer::FetchEventsByRange( /* * Set up the range of time for which we'll pull events... */ +#if 0 int iOffset = 30; d.prevDay(iOffset); psDTStart = d.toISO8601().toCString(""); d.nextDay(2 * iOffset); psDTEnd = d.toISO8601().toCString(""); +#endif + + psDTStart = aStart->toISO8601().toCString(""); + psDTEnd = aStop->toISO8601().toCString(""); /* * The data is actually read and parsed in another thread. Set it all diff --git a/calendar/modules/core/src/nsLayerCollection.cpp b/calendar/modules/core/src/nsLayerCollection.cpp index 552601c187c0..992068a3ca31 100644 --- a/calendar/modules/core/src/nsLayerCollection.cpp +++ b/calendar/modules/core/src/nsLayerCollection.cpp @@ -148,8 +148,8 @@ nsresult nsLayerCollection::GetCal(NSCalendar*& aCal) * @return NS_OK on success */ nsresult nsLayerCollection::FetchEventsByRange( - const DateTime* aStart, - const DateTime* aStop, + DateTime* aStart, + DateTime* aStop, JulianPtrArray* anArray ) {