Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread DateToStr and FormatSettings
Tue, Oct 31 2017 9:30 AMPermanent Link

Matthew Jones

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.

--

Matthew Jones
Tue, Oct 31 2017 10:03 AMPermanent Link

Matthew Jones

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.

--

Matthew Jones
Tue, Oct 31 2017 1:27 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< I'm sure I've brought this up before, but cannot find it. >>

Yep, it's on the list.

Tim Young
Elevate Software
www.elevatesoft.com
Image