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,7 +320,10 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
ShowMessage(Format(SInvalidDateTime, [CellEditor.Caption]));
|
ShowMessage(Format(SInvalidDateTime, [CellEditor.Caption]));
|
||||||
CellEditor.Text := FormatDateTime(DisplayFormat, Field.AsDateTime);
|
if Field.IsNull then
|
||||||
|
CellEditor.Text:= ''
|
||||||
|
else
|
||||||
|
CellEditor.Text := FormatDateTime(DisplayFormat, Field.AsDateTime);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
@ -363,7 +366,10 @@ 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]));
|
||||||
CellEditor.Text := FormatDateTime(DisplayFormat, theValue);
|
if Field.IsNull then
|
||||||
|
CellEditor.Text:= ''
|
||||||
|
else
|
||||||
|
CellEditor.Text := FormatDateTime(DisplayFormat, theValue);
|
||||||
CellEditor.SelectAll;
|
CellEditor.SelectAll;
|
||||||
Key := VK_UNKNOWN;
|
Key := VK_UNKNOWN;
|
||||||
end
|
end
|
||||||
@ -499,7 +505,10 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
ShowMessage(Format(SInvalidTime, [CellEditor.Caption]));
|
ShowMessage(Format(SInvalidTime, [CellEditor.Caption]));
|
||||||
CellEditor.Text := FormatDateTime(DisplayFormat, Field.AsDateTime);
|
if Field.IsNull then
|
||||||
|
CellEditor.Text:= ''
|
||||||
|
else
|
||||||
|
CellEditor.Text := FormatDateTime(DisplayFormat, Field.AsDateTime);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -540,7 +549,10 @@ 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]));
|
||||||
CellEditor.Text := FormatDateTime(DisplayFormat, theValue);
|
if Field.IsNull then
|
||||||
|
CellEditor.Text:= ''
|
||||||
|
else
|
||||||
|
CellEditor.Text := FormatDateTime(DisplayFormat, theValue);
|
||||||
CellEditor.SelectAll;
|
CellEditor.SelectAll;
|
||||||
Key := VK_UNKNOWN;
|
Key := VK_UNKNOWN;
|
||||||
end
|
end
|
||||||
@ -676,7 +688,10 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
ShowMessage(Format(SInvalidDate, [CellEditor.Caption]));
|
ShowMessage(Format(SInvalidDate, [CellEditor.Caption]));
|
||||||
CellEditor.Text := FormatDateTime(DisplayFormat, Field.AsDateTime);
|
if Field.IsNull then
|
||||||
|
CellEditor.Text:= ''
|
||||||
|
else
|
||||||
|
CellEditor.Text := FormatDateTime(DisplayFormat, Field.AsDateTime);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -718,7 +733,10 @@ 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]));
|
||||||
CellEditor.Text := FormatDateTime(DisplayFormat, theValue);
|
if Field.IsNull then
|
||||||
|
CellEditor.Text:= ''
|
||||||
|
else
|
||||||
|
CellEditor.Text := FormatDateTime(DisplayFormat, theValue);
|
||||||
CellEditor.SelectAll;
|
CellEditor.SelectAll;
|
||||||
Key := VK_UNKNOWN;
|
Key := VK_UNKNOWN;
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user