|Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread|
|Messages 1 to 2 of 2 total|
|Sat, Aug 19 2017 12:33 PM||Permanent Link|
I have 2 calendars and I want the number of days between the 2 selected dates in a counter (integer)
When I want to show the number of days:
the number of days is not shown and the system is no longer reacting.
What am I missing?
|Sat, Aug 19 2017 1:07 PM||Permanent Link|
On 8/19/2017 12:33 PM, Paul Waegemans wrote:
> I have 2 calendars and I want the number of days between the 2 selected dates in a counter (integer)
> When I want to show the number of days:
SelectedDate is a TimeDate type variable and as per EWB manual TimeDate
represents milliseconds (since 1970) so your "counter" at this point is
just milliseconds between the 2 dates and not days.
If you want actual days then you'd need to also divide it by
"milliseconds per day" which is 86400000 (24 hours x 60 min x 60sec x
> the number of days is not shown and the system is no longer reacting.
> What am I missing?
Showmessage is modal and so it requires you to click OK
You did not show actual code so i'm going to assume you are doing
something else after calling showmessage (like showing/hiding forms or
such which might hide the showmessage dialog).
This works just fine here and shows results as expected:
procedure TForm1.Button1Click(Sender: TObject);
counter := (Calendar2.selecteddate-Calendar1.selecteddate) div 86400000;