You've already forked lazarus-ccr
tvplanit: Fix display of repeated all-day events in the dayview.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8406 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -62,6 +62,7 @@ const
|
|||||||
);
|
);
|
||||||
|
|
||||||
NO_DATE = 9999999;
|
NO_DATE = 9999999;
|
||||||
|
FOREVER_DATE = 999999;
|
||||||
SecondsInDay = 86400; { Number of seconds in a day }
|
SecondsInDay = 86400; { Number of seconds in a day }
|
||||||
SecondsInHour = 3600; { Number of seconds in an hour }
|
SecondsInHour = 3600; { Number of seconds in an hour }
|
||||||
SecondsInMinute = 60; { Number of seconds in a minute }
|
SecondsInMinute = 60; { Number of seconds in a minute }
|
||||||
@@ -297,8 +298,6 @@ const
|
|||||||
|
|
||||||
LineEnding2 = LineEnding + LineEnding;
|
LineEnding2 = LineEnding + LineEnding;
|
||||||
|
|
||||||
FOREVER_DATE = 999999;
|
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
@@ -1952,6 +1952,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ Determines whether the given event repeats on the specified date. }
|
||||||
function TVpSchedule.RepeatsOn(Event: TVpEvent; Day: TDateTime): Boolean;
|
function TVpSchedule.RepeatsOn(Event: TVpEvent; Day: TDateTime): Boolean;
|
||||||
var
|
var
|
||||||
EY, EM, ED: Word;
|
EY, EM, ED: Word;
|
||||||
@@ -1972,17 +1973,14 @@ begin
|
|||||||
case Event.RepeatCode of
|
case Event.RepeatCode of
|
||||||
rtDaily:
|
rtDaily:
|
||||||
if DayInRepeatRange then
|
if DayInRepeatRange then
|
||||||
// if (Day < trunc(Event.RepeatRangeEnd) + 1) and (Day > trunc(Event.StartTime)) then
|
|
||||||
result := true;
|
result := true;
|
||||||
|
|
||||||
rtWeekly:
|
rtWeekly:
|
||||||
if DayInRepeatRange then
|
if DayInRepeatRange then
|
||||||
// if (Day < trunc(Event.RepeatRangeEnd) + 1) and (Day > trunc(Event.StartTime)) then
|
|
||||||
result := (Trunc(Day) - Trunc(Event.StartTime)) mod 7 = 0;
|
result := (Trunc(Day) - Trunc(Event.StartTime)) mod 7 = 0;
|
||||||
|
|
||||||
rtMonthlyByDay:
|
rtMonthlyByDay:
|
||||||
if DayInRepeatRange then
|
if DayInRepeatRange then
|
||||||
//if (Day < trunc(Event.RepeatRangeEnd) + 1) and (Day > trunc(Event.StartTime)) then
|
|
||||||
begin
|
begin
|
||||||
// Get the year, month and day of the first event in the series
|
// Get the year, month and day of the first event in the series
|
||||||
DecodeDate(Event.StartTime, EY, EM, ED);
|
DecodeDate(Event.StartTime, EY, EM, ED);
|
||||||
@@ -2003,7 +2001,6 @@ begin
|
|||||||
|
|
||||||
rtMonthlyByDate:
|
rtMonthlyByDate:
|
||||||
if DayInRepeatRange then
|
if DayInRepeatRange then
|
||||||
// if (Day < trunc(Event.RepeatRangeEnd) + 1) and (Day > trunc(Event.StartTime)) then
|
|
||||||
begin
|
begin
|
||||||
// Get the year, month and day of the first event in the series
|
// Get the year, month and day of the first event in the series
|
||||||
DecodeDate(Event.StartTime, EY, EM, ED);
|
DecodeDate(Event.StartTime, EY, EM, ED);
|
||||||
@@ -2015,7 +2012,6 @@ begin
|
|||||||
|
|
||||||
rtYearlyByDay:
|
rtYearlyByDay:
|
||||||
if DayInRepeatRange then
|
if DayInRepeatRange then
|
||||||
// if (Day < trunc(Event.RepeatRangeEnd) + 1) and (Day > trunc(Event.StartTime)) then
|
|
||||||
begin
|
begin
|
||||||
// Get the julian date of the first event in the series
|
// Get the julian date of the first event in the series
|
||||||
EventJulian := GetJulianDate(Event.StartTime);
|
EventJulian := GetJulianDate(Event.StartTime);
|
||||||
@@ -2027,7 +2023,6 @@ begin
|
|||||||
|
|
||||||
rtYearlyByDate:
|
rtYearlyByDate:
|
||||||
if DayInRepeatRange then
|
if DayInRepeatRange then
|
||||||
// if (Day < trunc(Event.RepeatRangeEnd) + 1) and (Day > trunc(Event.StartTime)) then
|
|
||||||
begin
|
begin
|
||||||
// Get the year, month and day of the first event in the series.
|
// Get the year, month and day of the first event in the series.
|
||||||
DecodeDate(Event.StartTime, EY, EM, ED);
|
DecodeDate(Event.StartTime, EY, EM, ED);
|
||||||
@@ -2039,7 +2034,6 @@ begin
|
|||||||
|
|
||||||
rtCustom:
|
rtCustom:
|
||||||
if DayInRepeatRange and (Event.CustomInterval > 0) then
|
if DayInRepeatRange and (Event.CustomInterval > 0) then
|
||||||
// if (Day < trunc(Event.RepeatRangeEnd) + 1) and (Day > trunc(Event.StartTime)) then
|
|
||||||
begin
|
begin
|
||||||
// If the number of elapsed days between the "Day" parameter and
|
// If the number of elapsed days between the "Day" parameter and
|
||||||
// the event start time is evenly divisible by the event's custom
|
// the event start time is evenly divisible by the event's custom
|
||||||
@@ -2049,7 +2043,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
function TVpSchedule.EventCountByDay(Value: TDateTime): Integer;
|
function TVpSchedule.EventCountByDay(Value: TDateTime): Integer;
|
||||||
var
|
var
|
||||||
@@ -2068,7 +2061,6 @@ begin
|
|||||||
Inc(Result);
|
Inc(Result);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpSchedule.EventsByDate(Date: TDateTime; EventList: TList);
|
procedure TVpSchedule.EventsByDate(Date: TDateTime; EventList: TList);
|
||||||
var
|
var
|
||||||
|
@@ -386,7 +386,8 @@ begin
|
|||||||
// Cycle through the all day events and draw them appropriately
|
// Cycle through the all day events and draw them appropriately
|
||||||
for I2 := 0 to pred(ADEventsList.Count) do begin
|
for I2 := 0 to pred(ADEventsList.Count) do begin
|
||||||
Event := ADEventsList[I2];
|
Event := ADEventsList[I2];
|
||||||
if DateInRange(RenderDate + I, Event.StartTime, Event.EndTime, true) then
|
if DateInRange(RenderDate + I, Event.StartTime, Event.EndTime, true) or
|
||||||
|
FDayView.DataStore.Resource.Schedule.RepeatsOn(Event, RenderDate + I) then
|
||||||
begin
|
begin
|
||||||
// See if the event began before the start of the range
|
// See if the event began before the start of the range
|
||||||
if (Event.StartTime < trunc(RenderDate)) then
|
if (Event.StartTime < trunc(RenderDate)) then
|
||||||
|
@@ -469,6 +469,8 @@ begin
|
|||||||
FRecurrenceFreq := L.Values['FREQ'];
|
FRecurrenceFreq := L.Values['FREQ'];
|
||||||
FRecurrenceInterval := StrToIntDef(L.Values['INTERVAL'], 0);
|
FRecurrenceInterval := StrToIntDef(L.Values['INTERVAL'], 0);
|
||||||
FRecurrenceEndDate := iCalDateTime(L.Values['UNTIL'], isUTC);
|
FRecurrenceEndDate := iCalDateTime(L.Values['UNTIL'], isUTC);
|
||||||
|
if FRecurrenceEndDate = 0 then
|
||||||
|
FRecurrenceEndDate := FOREVER_DATE;
|
||||||
FRecurrenceCount := StrToIntDef(L.Values['COUNT'], 0);
|
FRecurrenceCount := StrToIntDef(L.Values['COUNT'], 0);
|
||||||
FRecurrenceByXXX := '';
|
FRecurrenceByXXX := '';
|
||||||
for j:=0 to L.Count-1 do begin
|
for j:=0 to L.Count-1 do begin
|
||||||
|
Reference in New Issue
Block a user