Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread procedure TFormatSettings.Initialize should be public
Tue, Jan 23 2018 10:28 AMPermanent Link

Matthew Jones

At the moment, you cannot initialize a TFormatSettings that you have independent of the global one. This is a problem if you want the long names etc. Would be good to have it accessible.

--

Matthew Jones
Tue, Jan 23 2018 12:04 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< At the moment, you cannot initialize a TFormatSettings that you have independent of the global one. This is a problem if you want the long names etc. Would be good to have it accessible. >>

That class isn't really designed to be sub-classed and used like that, so I'll have to come up with a new design that allows such a sub-class to be created and initialized properly.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Jan 23 2018 12:19 PMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> Matthew,
>
> << At the moment, you cannot initialize a TFormatSettings that you have independent of the global one. This is a problem if you want the long names etc. Would be good to have it accessible. >>
>
> That class isn't really designed to be sub-classed and used like that, so I'll have to come up with a new design that allows such a sub-class to be created and initialized properly.

It's just part of the optimisation that I did to be able to pass in a TFormatSettings so I can separate uses.

I just fell over another issue in this:

 ShortTimeFormat := 'h:mm:ss tt';
 ShortTimeFormat := 'h:mm:ss'; // fails as invalid

If I don't want the AM/PM, then it should be optional. Nothing wrong with "3:05" as a time.

--

Matthew Jones
Fri, Jan 26 2018 12:34 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< I just fell over another issue in this:

 ShortTimeFormat := 'h:mm:ss tt';
 ShortTimeFormat := 'h:mm:ss'; // fails as invalid

If I don't want the AM/PM, then it should be optional. Nothing wrong with "3:05" as a time. >>

In which case you should use:

 ShortTimeFormat := 'H:mm:ss';

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Jan 26 2018 2:49 PMPermanent Link

Matthew Jones

Tim Young [Elevate Software] <timyoung@elevatesoft.com> wrote:
> Matthew,
>
> << I just fell over another issue in this:
>
>   ShortTimeFormat := 'h:mm:ss tt';
>   ShortTimeFormat := 'h:mm:ss'; // fails as invalid
>
> If I don't want the AM/PM, then it should be optional. Nothing wrong with
> "3:05" as a time. >>
>
> In which case you should use:
>
>   ShortTimeFormat := 'H:mm:ss';
>

Doesn’t that give me 15:05 then? I want 3:05.

--
Matthew Jones
Tue, Jan 30 2018 11:58 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Doesn’t that give me 15:05 then? I want 3:05.  >>

Then you're going to need to use an AM/PM indicator.  Otherwise, it's impossible for a date parser to understand the date in the way that you want it to.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Jan 31 2018 6:58 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> date parser

I'm just showing the current time, so this is for output only. Sure, I can understand that the parsing side might object, but it should do it when I parse, not when I display.

I guess though that the ability to truncate the output string solves the problem though.

--

Matthew Jones
Mon, Feb 5 2018 2:13 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< I'm just showing the current time, so this is for output only. Sure, I can understand that the parsing side might object, but it should do it when I parse, not when I display. >>

The formatting has to be parsed initially when you set it, in order to make sure that it's a valid format string.  After that, the short time format is used *everywhere* for time formatting/parsing, so it has to be correct or it cannot properly convert time strings into actual times.

Tim Young
Elevate Software
www.elevatesoft.com
Image