Fixes for TZAbstractTimestampFormatSettings
Posted: 03.04.2021, 11:48
The SetDateFormat and SetTimeFormat procedures use FFormat instead of either FDateFormat or FTimeFormat. Here are the fixed versions:
Thanks!
-Mark
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