How to migrate TDateTimeField to TZDateTimeField?
Posted: 14.12.2023, 18:10
Hi
I've been tasked with upgrading a large project that used ZeosLib 6.5.1 from Delphi 2007 to Delphi 10.2.
The original authors of the project had a habit of adding persistent fields everywhere, so obviously I ran into type mismatch on every field when opening any TZQuery. I wrote a program to help me with updating the classnames (wish I could just nuke the fields, but I can't, spaghetti is too strong).
Anyways, I'm not sure how to deal with TDateFimeField - specifically it's DisplayFormat and EditMask fields.
I understand that DisplayFormat is now TZDisplayTimestampFormatSettings, and there is now both EditMask and EditFormat, but given this example:
Which properties of TZDateTimeField need to be set to what values, in order to preserve the original behavior?
I've been tasked with upgrading a large project that used ZeosLib 6.5.1 from Delphi 2007 to Delphi 10.2.
The original authors of the project had a habit of adding persistent fields everywhere, so obviously I ran into type mismatch on every field when opening any TZQuery. I wrote a program to help me with updating the classnames (wish I could just nuke the fields, but I can't, spaghetti is too strong).
Anyways, I'm not sure how to deal with TDateFimeField - specifically it's DisplayFormat and EditMask fields.
I understand that DisplayFormat is now TZDisplayTimestampFormatSettings, and there is now both EditMask and EditFormat, but given this example:
Code: Select all
object QList_time: TDateTimeField
FieldName = 'time'
DisplayFormat = 'dd-mm-yyyy hh:mm'
end
object QList_deadline: TDateTimeField
FieldName = 'deadline'
EditMask = 'dd-mm-yyyy'
end