diff options
author | George Hazan <george.hazan@gmail.com> | 2023-05-15 20:07:36 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-05-15 20:07:36 +0300 |
commit | b320ce679f51799ca9d63a146958ec8e3944a839 (patch) | |
tree | 8d4ead78bdcd6a85bff5e89ff4ff1b3ababf7840 /plugins/HistoryPlusPlus | |
parent | f6a94dd224027c964cdefb2061d8a69a7757ad70 (diff) |
fixes #3514 (Import cannot import H++ txt history with yyyy-mm-dd date format)
Diffstat (limited to 'plugins/HistoryPlusPlus')
-rw-r--r-- | plugins/HistoryPlusPlus/HistoryGrid.pas | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/HistoryPlusPlus/HistoryGrid.pas b/plugins/HistoryPlusPlus/HistoryGrid.pas index 5e89117773..ab0ad610d7 100644 --- a/plugins/HistoryPlusPlus/HistoryGrid.pas +++ b/plugins/HistoryPlusPlus/HistoryGrid.pas @@ -4890,6 +4890,11 @@ begin end;
end;
+function TimestampToDdMmYyyy(const Timestamp: DWord): String;
+begin
+ Result := FormatDateTime('dd.mm.yyyy hh:nn:ss',TimestampToDateTime(Timestamp));
+end;
+
procedure THistoryGrid.SaveItem(Stream: TFileStream; Item: Integer; SaveFormat: TSaveFormat);
procedure MesTypeToStyle(mt: TMessageTypes; out mes_id, type_id: Utf8String);
@@ -4924,7 +4929,7 @@ procedure THistoryGrid.SaveItem(Stream: TFileStream; Item: Integer; SaveFormat: FullHeader := not(FGroupLinked and FItems[Item].LinkedToPrev);
if FullHeader then
begin
- Time := GetTime(Items[Item].Time);
+ Time := TimestampToDdMmYyyy(Items[Item].Time);
if mtIncoming in FItems[Item].MessageType then
nick := ContactName
else
@@ -5003,7 +5008,7 @@ procedure THistoryGrid.SaveItem(Stream: TFileStream; Item: Integer; SaveFormat: FullHeader := not(FGroupLinked and FItems[Item].LinkedToPrev);
if FullHeader then
begin
- Time := GetTime(FItems[Item].Time);
+ Time := TimestampToDdMmYyyy(FItems[Item].Time);
if mtIncoming in FItems[Item].MessageType then
nick := ContactName
else
@@ -5033,7 +5038,7 @@ procedure THistoryGrid.SaveItem(Stream: TFileStream; Item: Integer; SaveFormat: FullHeader := not(FGroupLinked and FItems[Item].LinkedToPrev);
if FullHeader then
begin
- Time := GetTime(FItems[Item].Time);
+ Time := TimestampToDdMmYyyy(FItems[Item].Time);
if mtIncoming in FItems[Item].MessageType then
nick := ContactName
else
@@ -5069,7 +5074,7 @@ procedure THistoryGrid.SaveItem(Stream: TFileStream; Item: Integer; SaveFormat: Text := ProfileName;
if Assigned(FGetNameData) then
FGetNameData(Self, Item, Text);
- Text := Text + ' [' + GetTime(FItems[Item].Time) + ']:';
+ Text := Text + ' [' + TimestampToDdMmYyyy(FItems[Item].Time) + ']:';
RTFStream := '{\rtf1\par\b1 ' + FormatString2RTF(Text) + '\b0\par}';
SetRichRTF(FRichSave.Handle, RTFStream, True, False, False);
end;
|