Jump to content

Two problems about uniDateTimePicker


lxpbuaa

Recommended Posts

Hi,

I uses a uniDateTimePicker to edit a datetime column of a DBGrid. The field type is TSQLTimeStampField.

There are 2 problems:
1. When enter the editor and leave it, the date (e.g "2018-01-11") always changes to a GMT datetime text.  

2. Atfer change the date value, the error "Could not parse SQL TimeStamp string" raises.

Thanks!

 

 

TIM图片20180917195528.png

Link to comment
Share on other sites

I asked myself:

1. FireDAC deals all date/time field as SQLTimeStamp field, and uniDateTimePicker ignores the prolem.   To solve this prolem as:

 FConnection.FormatOptions.OwnMapRules := True;
  with FConnection.FormatOptions.MapRules.Add do
  begin
    SourceDataType := dtDateTimeStamp;
    TargetDataType := dtDateTime;
  end;

2. Another prolem, uniDateTimePicker raises "xxxx-xx-xx" is not valid date time. uniDBGrid.pas has codes as below:

SetFldValue……

D := StrToDateTime(AVal, FmtSettings);  --FmtSettings is   a new global var in uniGUIApplication, why don't use SysUtils.FormatSettings? Change values of FmtSettings and the prolem solved.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...