Page 1 of 1

MinDate

PostPosted: 12 Jul 2016 08:41
by etwoss
Hi

Seems easy but i don't see the MinDate value beeing tested:

Code: Select all
procedure TIWEditOrderItem.SetValidFrom(const Value: TDateTime);
var
  FormatString : String;
begin
  FValidFrom := Value;
  FormatString := ARR_WEBDATEFORMAT[UserSession.IMSession.WebDateFormat];
  dtpCancelDate.JQDatePickerOptions.DateFormat :=  FormatString;
  dtpCancelDate.Date := FValidFrom;
  dtpCancelDate.JQDatePickerOptions.MinDate := Value;
end;

FormatString = 'd-m-yyyy'

When should the internal check on MinDate take place ?

Eric

Re: MinDate

PostPosted: 14 Jul 2016 16:32
by Alexander Bulei
Hi Eric,

What do you mean with testing? And what is the problem?

Best Regards.

Re: MinDate

PostPosted: 15 Jul 2016 08:34
by etwoss
Hi

I expected an error message when i enter a date which is before the mindate

Eric

Re: MinDate

PostPosted: 15 Jul 2016 09:34
by Alexander Bulei
Hi Eric,

MinDate will restrict the selecting of dates in popup.
If you want show some message, do it by yourself by using the available events.

Best Regards.

Re: MinDate

PostPosted: 19 Jul 2016 11:02
by etwoss
Hi

I have this code:

Code: Select all
procedure TIWEditOrderItem.SetValidFrom(const Value: TDateTime);
var
  FormatString : String;
begin
  FormatString := ARR_WEBDATEFORMAT[UserSession.IMSession.WebDateFormat];
  dtpCancelDate.JQDatePickerOptions.DateFormat :=  FormatString;
  dtpCancelDate.JQDatePickerOptions.MinDate := Value;
end;


ARR_WEBDATEFORMAT: array[TWebDateFormat] of String =
( 'd-m-yyyy'
, 'd/m/yyyy'
, 'd.m.yyyy'
, 'yyyy-m-d'
, 'yyyy/m/d'
);

MinDate does work for d-m-yyyy on my pc, on tester it works on d/m/yyyy.
when using d.m.yyyy i can move to dates before the mindate
On the tester pc when using d-m-yyyy it opens with a min date in 2022!

Whats happening?

Eric

Re: MinDate

PostPosted: 19 Jul 2016 13:22
by etwoss
Hi

Some images to show the problem. The first screenshot d/m/yyyy is the calender dataformat, Min date is 1/1/2016 , can't browse back to earlier date than 1/1/2016

Second image, date format is d-m-yyyy , mindate is also set to 1/1/2016, the popup shows 27 jan 2022 as the mindate!

Eric

Re: MinDate

PostPosted: 21 Jul 2016 18:12
by Alexander Bulei
Hi Eric,

Checking.....

But:

The first screenshot d/m/yyyy is the calender dataformat, Min date is 1/1/2016 , can't browse back to earlier date than 1/1/2016


Is this a problem for you?

Best Regards.

Re: MinDate

PostPosted: 21 Jul 2016 18:23
by Alexander Bulei
Eric,

Second image, date format is d-m-yyyy , mindate is also set to 1/1/2016, the popup shows 27 jan 2022 as the mindate!


And why are you setting the minDate to "1/1/2016" if your date format is " d-m-yyyy"????

Best Regards.

Re: MinDate

PostPosted: 25 Jul 2016 07:14
by etwoss
Hi

Code: Select all
procedure TIWEditOrderItem.SetValidFrom(const Value: TDateTime);
begin
..
  dtpCancelDate.JQDatePickerOptions.MinDate := Value;
end;


So value is a TDateTime, so should work fine, right?

Eric

Re: MinDate

PostPosted: 25 Jul 2016 10:07
by Alexander Bulei
Hi Eric,

I have implenented the handle code to this case....
Thanks.

Best Regards.