CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

MinDate

by etwoss » 12 Jul 2016 08:41

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
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Alexander Bulei » 14 Jul 2016 16:32

Hi Eric,

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

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by etwoss » 15 Jul 2016 08:34

Hi

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

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Alexander Bulei » 15 Jul 2016 09:34

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.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by etwoss » 19 Jul 2016 11:02

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
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by etwoss » 19 Jul 2016 13:22

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
You do not have the required permissions to view the files attached to this post.
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Alexander Bulei » 21 Jul 2016 18:12

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.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by Alexander Bulei » 21 Jul 2016 18:23

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.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by etwoss » 25 Jul 2016 07:14

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
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Alexander Bulei » 25 Jul 2016 10:07

Hi Eric,

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

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQDatePicker

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.