diff --git a/components/tvplanit/source/vpdata.pas b/components/tvplanit/source/vpdata.pas index 3067caa93..ca8394cda 100644 --- a/components/tvplanit/source/vpdata.pas +++ b/components/tvplanit/source/vpdata.pas @@ -1434,9 +1434,9 @@ begin Result.Alarm.Audio := (FDingPath <> '') and FileExists(FDingPath); Result.Alarm.AudioSrc := FDingPath; case FAlarmAdvType of - atMinutes: Result.Alarm.Trigger := -FAlarmAdv * OneMinute; - atHours: Result.Alarm.Trigger := -FAlarmAdv * OneHour; - atDays: Result.Alarm.Trigger := -FAlarmAdv; + atMinutes: Result.Alarm.Trigger := -abs(FAlarmAdv) * OneMinute; + atHours: Result.Alarm.Trigger := -abs(FAlarmAdv) * OneHour; + atDays: Result.Alarm.Trigger := -abs(FAlarmAdv); end; Result.Alarm.RepeatCount := 1; end; diff --git a/components/tvplanit/source/vpical.pas b/components/tvplanit/source/vpical.pas index 2c82317ec..f6dfaae61 100644 --- a/components/tvplanit/source/vpical.pas +++ b/components/tvplanit/source/vpical.pas @@ -252,11 +252,11 @@ begin isNeg := true; AValue := -AValue; end; - if IsInteger(AValue, 1.0 / SecondsInDay) then + if IsInteger(AValue*SecondsInDay, 1.0 / SecondsInDay) then Result :=Format('P%dS', [round(AValue * SecondsInDay)]) - else if IsInteger(AValue, 1.0/MinutesInDay) then + else if IsInteger(AValue*MinutesInDay, 1.0/MinutesInDay) then Result := Format('P%dM', [round(AValue * MinutesInDay)]) - else if IsInteger(AValue, 1.0/HoursInday) then + else if IsInteger(AValue*HoursInDay, 1.0/HoursInDay) then Result := Format('P%dH', [round(AValue * HoursInDay)]) else if IsInteger(AValue, 1.0) then Result := Format('P%dD', [round(AValue)])