|Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread|
|Messages 1 to 3 of 3 total|
|DateToStr and FormatSettings|
|Tue, Oct 31 2017 9:30 AM||Permanent Link|
I'm sure I've brought this up before, but cannot find it. It would be really good if DateToStr and the similar routines could take an optional FormatSettings object passed in. If nil is passed, they'd use the standard one.
The reason is that I have a simple line that wasn't working.
FormatSettings.ShortDateFormat := 'dd MM yyyy';
FormatSettings.DateSeparator := '/';
szValue := DateToStr(xml_X2DateTime(szValue), false);
The reason of course is that xml_X2DateTime sets the short date format to match the ISO format for StrToDate to use. Which would be fine, but in filling a grid with 8,000 items, each with two dates, that's a lot of messing about with FormatSettings which could be much faster if I could set it up once and pass it in. Plus I have to split this line in two of course.
|Tue, Oct 31 2017 10:03 AM||Permanent Link|
Matthew Jones wrote:
> really good if DateToStr and the similar routines could take an optional FormatSettings object passed in
Get off you fat *&"( and do it yourself Matthew! A quick copy and paste, and a fake class definition to get access to the private functions of TFormatSettings and this is done. Simples.
|Tue, Oct 31 2017 1:27 PM||Permanent Link|
Tim Young [Elevate Software]
Elevate Software, Inc.
<< I'm sure I've brought this up before, but cannot find it. >>
Yep, it's on the list.