From 40a1394e3c2841bf2f4969db952abe04a8a00025 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 21 Aug 2022 15:29:39 +0000 Subject: [PATCH] tvplanit: Fix export of advance alarm time to ical event. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8408 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/source/vpdata.pas | 6 +++--- components/tvplanit/source/vpical.pas | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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)])