You've already forked lazarus-ccr
Extra checks for db null dates
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2341 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -320,6 +320,9 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
ShowMessage(Format(SInvalidDateTime, [CellEditor.Caption]));
|
ShowMessage(Format(SInvalidDateTime, [CellEditor.Caption]));
|
||||||
|
if Field.IsNull then
|
||||||
|
CellEditor.Text:= ''
|
||||||
|
else
|
||||||
CellEditor.Text := FormatDateTime(DisplayFormat, Field.AsDateTime);
|
CellEditor.Text := FormatDateTime(DisplayFormat, Field.AsDateTime);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -363,6 +366,9 @@ begin
|
|||||||
(not IsValidDateTimeString(NormalizeDateTime(CellEditor.Caption, theValue))) then
|
(not IsValidDateTimeString(NormalizeDateTime(CellEditor.Caption, theValue))) then
|
||||||
begin
|
begin
|
||||||
ShowMessage(Format(SInvalidDateTime, [CellEditor.Caption]));
|
ShowMessage(Format(SInvalidDateTime, [CellEditor.Caption]));
|
||||||
|
if Field.IsNull then
|
||||||
|
CellEditor.Text:= ''
|
||||||
|
else
|
||||||
CellEditor.Text := FormatDateTime(DisplayFormat, theValue);
|
CellEditor.Text := FormatDateTime(DisplayFormat, theValue);
|
||||||
CellEditor.SelectAll;
|
CellEditor.SelectAll;
|
||||||
Key := VK_UNKNOWN;
|
Key := VK_UNKNOWN;
|
||||||
@ -499,6 +505,9 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
ShowMessage(Format(SInvalidTime, [CellEditor.Caption]));
|
ShowMessage(Format(SInvalidTime, [CellEditor.Caption]));
|
||||||
|
if Field.IsNull then
|
||||||
|
CellEditor.Text:= ''
|
||||||
|
else
|
||||||
CellEditor.Text := FormatDateTime(DisplayFormat, Field.AsDateTime);
|
CellEditor.Text := FormatDateTime(DisplayFormat, Field.AsDateTime);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -540,6 +549,9 @@ begin
|
|||||||
(not IsValidTimeString(NormalizeTime(CellEditor.Caption, theValue))) then
|
(not IsValidTimeString(NormalizeTime(CellEditor.Caption, theValue))) then
|
||||||
begin
|
begin
|
||||||
ShowMessage(Format(SInvalidTime, [CellEditor.Caption]));
|
ShowMessage(Format(SInvalidTime, [CellEditor.Caption]));
|
||||||
|
if Field.IsNull then
|
||||||
|
CellEditor.Text:= ''
|
||||||
|
else
|
||||||
CellEditor.Text := FormatDateTime(DisplayFormat, theValue);
|
CellEditor.Text := FormatDateTime(DisplayFormat, theValue);
|
||||||
CellEditor.SelectAll;
|
CellEditor.SelectAll;
|
||||||
Key := VK_UNKNOWN;
|
Key := VK_UNKNOWN;
|
||||||
@ -676,6 +688,9 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
ShowMessage(Format(SInvalidDate, [CellEditor.Caption]));
|
ShowMessage(Format(SInvalidDate, [CellEditor.Caption]));
|
||||||
|
if Field.IsNull then
|
||||||
|
CellEditor.Text:= ''
|
||||||
|
else
|
||||||
CellEditor.Text := FormatDateTime(DisplayFormat, Field.AsDateTime);
|
CellEditor.Text := FormatDateTime(DisplayFormat, Field.AsDateTime);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -718,6 +733,9 @@ begin
|
|||||||
(not IsValidDateString(NormalizeDate(CellEditor.Caption, theValue))) then
|
(not IsValidDateString(NormalizeDate(CellEditor.Caption, theValue))) then
|
||||||
begin
|
begin
|
||||||
ShowMessage(Format(SInvalidDate, [CellEditor.Caption]));
|
ShowMessage(Format(SInvalidDate, [CellEditor.Caption]));
|
||||||
|
if Field.IsNull then
|
||||||
|
CellEditor.Text:= ''
|
||||||
|
else
|
||||||
CellEditor.Text := FormatDateTime(DisplayFormat, theValue);
|
CellEditor.Text := FormatDateTime(DisplayFormat, theValue);
|
||||||
CellEditor.SelectAll;
|
CellEditor.SelectAll;
|
||||||
Key := VK_UNKNOWN;
|
Key := VK_UNKNOWN;
|
||||||
|
Reference in New Issue
Block a user