From de22b0fbbd94b8c657a17a236081ff9014df1013 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Wed, 29 Jun 2016 20:32:12 +0000 Subject: [PATCH] tvplanit: Fix weekview displaying repeated events to begin at midnight after the second event. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4868 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/languages/demo.de.po | 54 +++++++++++++++++++ components/tvplanit/languages/demo.po | 54 +++++++++++++++++++ .../tvplanit/source/vpweekviewpainter.pas | 12 +++-- 3 files changed, 116 insertions(+), 4 deletions(-) diff --git a/components/tvplanit/languages/demo.de.po b/components/tvplanit/languages/demo.de.po index 2e455a26d..fecb4d698 100644 --- a/components/tvplanit/languages/demo.de.po +++ b/components/tvplanit/languages/demo.de.po @@ -129,6 +129,60 @@ msgstr "Dienstag" msgid "Wednesday" msgstr "Mittwoch" +#: tfrmreportsetup.button1.caption +msgctxt "tfrmreportsetup.button1.caption" +msgid "OK" +msgstr "" + +#: tfrmreportsetup.button2.caption +msgctxt "tfrmreportsetup.button2.caption" +msgid "Cancel" +msgstr "" + +#: tfrmreportsetup.caption +msgid "Report Setup" +msgstr "" + +#: tfrmreportsetup.dateedit1.cancelcaption +msgctxt "tfrmreportsetup.dateedit1.cancelcaption" +msgid "Cancel" +msgstr "" + +#: tfrmreportsetup.dateedit1.okcaption +msgctxt "tfrmreportsetup.dateedit1.okcaption" +msgid "OK" +msgstr "" + +#: tfrmreportsetup.dateedit1.text +msgid "DateEdit1" +msgstr "" + +#: tfrmreportsetup.dateedit2.cancelcaption +msgctxt "tfrmreportsetup.dateedit2.cancelcaption" +msgid "Cancel" +msgstr "" + +#: tfrmreportsetup.dateedit2.okcaption +msgctxt "tfrmreportsetup.dateedit2.okcaption" +msgid "OK" +msgstr "" + +#: tfrmreportsetup.dateedit2.text +msgid "DateEdit2" +msgstr "" + +#: tfrmreportsetup.label1.caption +msgid "Start Date:" +msgstr "" + +#: tfrmreportsetup.label2.caption +msgid "End Date:" +msgstr "" + +#: tfrmreportsetup.label3.caption +msgid "Format:" +msgstr "" + #: tmainform.btndeleteres.caption msgid "Delete" msgstr "Löschen" diff --git a/components/tvplanit/languages/demo.po b/components/tvplanit/languages/demo.po index d925865d2..800caaf87 100644 --- a/components/tvplanit/languages/demo.po +++ b/components/tvplanit/languages/demo.po @@ -118,6 +118,60 @@ msgstr "" msgid "Wednesday" msgstr "" +#: tfrmreportsetup.button1.caption +msgctxt "tfrmreportsetup.button1.caption" +msgid "OK" +msgstr "" + +#: tfrmreportsetup.button2.caption +msgctxt "tfrmreportsetup.button2.caption" +msgid "Cancel" +msgstr "" + +#: tfrmreportsetup.caption +msgid "Report Setup" +msgstr "" + +#: tfrmreportsetup.dateedit1.cancelcaption +msgctxt "TFRMREPORTSETUP.DATEEDIT1.CANCELCAPTION" +msgid "Cancel" +msgstr "" + +#: tfrmreportsetup.dateedit1.okcaption +msgctxt "TFRMREPORTSETUP.DATEEDIT1.OKCAPTION" +msgid "OK" +msgstr "" + +#: tfrmreportsetup.dateedit1.text +msgid "DateEdit1" +msgstr "" + +#: tfrmreportsetup.dateedit2.cancelcaption +msgctxt "TFRMREPORTSETUP.DATEEDIT2.CANCELCAPTION" +msgid "Cancel" +msgstr "" + +#: tfrmreportsetup.dateedit2.okcaption +msgctxt "TFRMREPORTSETUP.DATEEDIT2.OKCAPTION" +msgid "OK" +msgstr "" + +#: tfrmreportsetup.dateedit2.text +msgid "DateEdit2" +msgstr "" + +#: tfrmreportsetup.label1.caption +msgid "Start Date:" +msgstr "" + +#: tfrmreportsetup.label2.caption +msgid "End Date:" +msgstr "" + +#: tfrmreportsetup.label3.caption +msgid "Format:" +msgstr "" + #: tmainform.btndeleteres.caption msgid "Delete" msgstr "" diff --git a/components/tvplanit/source/vpweekviewpainter.pas b/components/tvplanit/source/vpweekviewpainter.pas index a9964960b..c576a35b6 100644 --- a/components/tvplanit/source/vpweekviewpainter.pas +++ b/components/tvplanit/source/vpweekviewpainter.pas @@ -480,10 +480,14 @@ begin { format the display text } todayStartTime := AEvent.StartTime; todayEndTime := AEvent.EndTime; - if trunc(todayStartTime) < trunc(StartDate + ADayIndex) then // first event - todayStartTime := 0; - if trunc(TodayEndTime) > trunc(StartDate + ADayIndex) then // last event - todayEndTime := 0.9999; + + // Event reaches into the next day(s) + if trunc(todayEndTime) > trunc(todayStartTime) then begin + if trunc(todayStartTime) < trunc(StartDate + ADayIndex) then // first event + todayStartTime := 0; + if trunc(TodayEndTime) > trunc(StartDate + ADayIndex) then // last event + todayEndTime := 0.9999; + end; { set the event font } RenderCanvas.Font.Assign(FWeekView.EventFont);