CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

IWCGJQTimePicker shows 00:00 when field is empty

by rhazell43 » 09 Oct 2013 09:54

Hello,

When connected to a DataSource the IWCGJQTimePicker shows 00:00 when field is empty. IWCGJQDatePicker behaves correctly and displays and empty edit... IWCGJQTimePicker should behave the same.

Thanks, Rick.
rhazell43
 
Posts: 80
Joined: 29 Apr 2013 08:27

by Jorge Sousa » 09 Oct 2013 19:36

Hi Rick,

the problem with this is just one:

We consider a null date if its value is 0, which is equivalent to the min date: 12/30/1899

But for times we can't do the same, because 0 is equivalent to 00:00, a valid time.

Do you have any suggestion to overcome this problem?

Best Regards
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by rhazell43 » 09 Oct 2013 20:41

Can you use the IsNull property of a field? Like:

tblSessionCalc_.FieldByName('SessionDate').IsNull;
rhazell43
 
Posts: 80
Joined: 29 Apr 2013 08:27

by Jorge Sousa » 09 Oct 2013 23:44

Hi Rick

Yes sure, but DataLink is just a 2nd level, we've to establish a value for a null time as well

Regards
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by rhazell43 » 10 Oct 2013 02:31

how about a blank?
rhazell43
 
Posts: 80
Joined: 29 Apr 2013 08:27

by rhazell43 » 16 Oct 2013 01:33

Maybe add an option (that we can set) to imply 00:00 is a null time?

Thanks.
rhazell43
 
Posts: 80
Joined: 29 Apr 2013 08:27

by etwoss » 23 Nov 2016 14:51

Hi

I'm having the same problem.
Not consistent with datetime picker.
I understand the explanation but also see a solution in a IsNull property on the component
if Set to true dont show 00:00

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

by etwoss » 28 Nov 2016 11:34

Hi

Sourcecode:

Code: Select all
procedure TIWCGJQCustomTimePicker.DataLinkUpdateControl;
begin
  Time:= TimeOf(DataLink.Field.AsDateTime)
end;


can be replaced with

Code: Select all
procedure TIWCGJQCustomTimePicker.DataLinkUpdateControl;
begin
   if (DataLink.Field.IsNull) then
  begin
     FTimeIsNull := True; // New internal property
  end
  else
  begin
     Time:= TimeOf(DataLink.Field.AsDateTime);
     FTimeIsNull := False;
  end;
 
end;


Based on FTimeIsNull true of false the component shows up empty or filled
Perhaps this is a nice solution for this problem

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

by Alexander Bulei » 29 Nov 2016 19:20

Hi,

Added new property NullAsEmpty to DataLink in next beta build.

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 » 30 Nov 2016 08:05

Hi

Great work!

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

Next

Return to JQTimePicker

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.