Code: Select all
procedure TZAbstractTimestampFormatSettings.SetDateFormat(const Value: String);
begin
if ((FDateFormat = nil) and (Value <> '')) or ((FDateFormat <> nil) and (Value = '')) or ((FDateFormat <> nil) and (FDateFormat^ <> Value)) then begin
if Value <> '' then begin
FDateFormat := @FFormatSettings.ShortDateFormat;
FDateFormat^ := Value;
end else FDateFormat := nil;
if Assigned(FOnFormatChanged) then
FOnFormatChanged;
end;
end;
procedure TZAbstractTimestampFormatSettings.SetTimeFormat(const Value: String);
begin
if ((FTimeFormat = nil) and (Value <> '')) or ((FTimeFormat <> nil) and (Value = '')) or ((FTimeFormat <> nil) and (FTimeFormat^ <> Value)) then begin
if Value <> '' then begin
FTimeFormat := @FFormatSettings.ShortTimeFormat;
FTimeFormat^ := Value;
end else FTimeFormat := nil;
if Assigned(FOnFormatChanged) then
FOnFormatChanged;
end;
end;
-Mark