Re: [Lazarus] Extended format codes in FormatDateTime (Michael Van Canneyt)

2014-05-17 Thread Michael Van Canneyt



On Sat, 17 May 2014, Werner Pamler wrote:

I just uploaded a new patch to bug tracker. The new version picks up 
Michael's suggestion of introducing a new FormatDateTimeEx function for the 
new format codes.


Damn, I was rather hoping you'd go for the extra argument :)
No sweat, I'll rework it, thanks for the contribution.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Extended format codes in FormatDateTime (Michael Van Canneyt)

2014-05-16 Thread Werner Pamler
I just uploaded a new patch to bug tracker. The new version picks up 
Michael's suggestion of introducing a new FormatDateTimeEx function for 
the new format codes.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Extended format codes in FormatDateTime

2014-05-16 Thread Michael Van Canneyt



On Fri, 16 May 2014, Marco van de Voort wrote:


On Fri, May 16, 2014 at 01:19:15AM +0200, Werner Pamler wrote:

In BugTracker, #0026168, I posted a patch to FormatDateTime which allows
to use hour, minute, or second format codes in square brackets.


Using new special characters instead of building on existing escape
characters is incompatible.


This could be remedied with a FormatDateTimeEx() or else a 
FormatDateTime(Fmt,date,AllowExtendedFormatting: Boolean = False)


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Extended format codes in FormatDateTime

2014-05-16 Thread Marco van de Voort
On Fri, May 16, 2014 at 01:19:15AM +0200, Werner Pamler wrote:
> In BugTracker, #0026168, I posted a patch to FormatDateTime which allows 
> to use hour, minute, or second format codes in square brackets.

Using new special characters instead of building on existing escape
characters is incompatible.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Extended format codes in FormatDateTime

2014-05-15 Thread Werner Pamler
In BugTracker, #0026168, I posted a patch to FormatDateTime which allows 
to use hour, minute, or second format codes in square brackets. If such 
codes are found in the format string the values of the corresponding 
quantitites do no longer overflow, but can grow beyond their usual limit 
of 24 (for hours) or 60 (for minutes and seconds). The idea behind that 
is that when adding or subtracting times the hours often become greater 
than 24, but there may be a wish to keep an hh:nn format without days. I 
need that feature in my current work with the fpspreadsheet date/time 
formats since Excel offers this [h]:mm:ss format string. Currently I 
have a patched version in the package, but it certainly would be better 
to have this feature in fpc/Lazarus generally.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus