Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 14 total
Thread error when changing formatsettings.DateSeparator
Sun, Sep 25 2016 8:51 AMPermanent Link

Ronald

Hi,

I have a form with a TCalendar and if I show it I get the error:

Error: Persistent Load Error(Persistent Load Error(Persistent Load Error(Invalid date)))

This only occurs if I change the formatsettings of the date.

How can I go around the error?

Greetings,
Ronald
Sun, Sep 25 2016 11:07 AMPermanent Link

erickengelke

Ronald wrote:
> have a form with a TCalendar and if I show it I get the error:
>Error: Persistent Load Error(Persistent Load Error(Persistent Load Error(Invalid date)))
>This only occurs if I change the formatsettings of the date.
>How can I go around the error?


I don;t have an answer, but it reminds me that people outside the USA don't care for the calendar's representation of the date.  The ISO standard way and common in many countries is YYYY/M/d, so it would be a nice thing if EWB had a flag to display the date that way.

Erick
Sun, Sep 25 2016 2:11 PMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 9/25/2016 8:51 AM, Ronald wrote:
> I have a form with a TCalendar and if I show it I get the error:
>
> Error: Persistent Load Error(Persistent Load Error(Persistent Load Error(Invalid date)))
>
> This only occurs if I change the formatsettings of the date.
>
> How can I go around the error?

What are you setting the date format to exactly ?

If you're changing the fate separator at the same time as format then
make sure sure you update both properties of formatsettings.

For example to get 2016-09-25 (which uses '-' as separator and 2 digit
month and day) then you need to do this (say in form OnCreate):

   FormatSettings.DateSeparator := '-';
   FormatSettings.ShortDateFormat := 'yyyy-MM-dd';


Raul
Sun, Sep 25 2016 3:55 PMPermanent Link

Ronald

erickengelke wrote:

Ronald wrote:
> have a form with a TCalendar and if I show it I get the error:
>Error: Persistent Load Error(Persistent Load Error(Persistent Load Error(Invalid date)))
>This only occurs if I change the formatsettings of the date.
>How can I go around the error?


I don;t have an answer, but it reminds me that people outside the USA don't care for the calendar's representation of the date.  The ISO standard way and common in many countries is YYYY/M/d, so it would be a nice thing if EWB had a flag to display the date that way.

Erick

Hi Erick,

In the Netherlands it is d-M-YYYY, people would reject the USA representation.

Greetings,
Ronald
btw Just bought your book.
Sun, Sep 25 2016 3:59 PMPermanent Link

Ronald

Raul wrote:

On 9/25/2016 8:51 AM, Ronald wrote:
> I have a form with a TCalendar and if I show it I get the error:
>
> Error: Persistent Load Error(Persistent Load Error(Persistent Load Error(Invalid date)))
>
> This only occurs if I change the formatsettings of the date.
>
> How can I go around the error?

What are you setting the date format to exactly ?

If you're changing the fate separator at the same time as format then
make sure sure you update both properties of formatsettings.

For example to get 2016-09-25 (which uses '-' as separator and 2 digit
month and day) then you need to do this (say in form OnCreate):

   FormatSettings.DateSeparator := '-';
   FormatSettings.ShortDateFormat := 'yyyy-MM-dd';


Raul

Hi Raul,

The format that I use is correct and I used it in EWB 1 too. I ithink that EWB evaluates the date against the formatsetings that I have changed, but maybe it first evaluates the default text in the control that is in USA format because EWB ignores my local setting when working in the IDE. Hope you undertand what I mean.

Greetings,
Ronald
Sun, Sep 25 2016 4:07 PMPermanent Link

erickengelke

Ronald wrote:

erickengelke wrote:

Ronald wrote:
>I don;t have an answer, but it reminds me that people outside the USA don't care for the calendar's
> representation of the date.  The ISO standard way and common in many countries is YYYY/M/d, so it would be a >nice thing if EWB had a flag to display the date that way.

>In the Netherlands it is d-M-YYYY, people would reject the USA representation.

My mother was from the Netherlands.

Perhaps a user definable global string to set the date format would be preferred.

> btw Just bought your book.

I hope you like it.  After six intense months of writing, it felt like I had exhausted the topic list.  But I guess this was something I missed.

Erick
Sun, Sep 25 2016 4:13 PMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 9/25/2016 3:59 PM, Ronald wrote:
> The format that I use is correct and I used it in EWB 1 too. I ithink that EWB evaluates the date against the formatsetings that I have changed, but maybe it first evaluates the default text in the control that is in USA format because EWB ignores my local setting when working in the IDE. Hope you undertand what I mean.

Ronald,

But what is the format and where exactly do you get the error ?

I just tried EWB app with the format as
    FormatSettings.DateSeparator := '-';
    FormatSettings.ShortDateFormat := 'yyyy-MM-dd';

and Calendar did not generate any errors and date it returns is in the
correct format.

I'm just saying that i cannot duplicate the issue you are having with
EWB 2.05 Build 4 so you'd need to provide bit more info (steps).

Raul
Sun, Sep 25 2016 4:21 PMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 9/25/2016 4:13 PM, Raul wrote:
> I'm just saying that i cannot duplicate the issue you are having with
> EWB 2.05 Build 4 so you'd need to provide bit more info (steps).

OK - in your other post you referred to the format of "d-M-YYYY"

Looking at manual this might not be fully correct (there is no YYYY
though there is yyyy):

http://www.elevatesoft.com/manual?action=viewprop&id=ewb2&comp=TFormatSettings&prop=ShortDateFormat


So doing

  FormatSettings.DateSeparator := '-';
  FormatSettings.ShortDateFormat := 'd-M-yyyy';

works fine here and TCalendar returns dates like

26-9-2016
1-9-2016
etc

Raul
Mon, Sep 26 2016 1:16 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< I don;t have an answer, but it reminds me that people outside the USA don't care for the calendar's representation of the date.  The ISO standard way and common in many countries is YYYY/M/d, so it would be a nice thing if EWB had a flag to display the date that way. >>

Which part are you referring to ?  The global FormatSettings instance allows you to control the short date format of the date in a TDateEditComboBox, the long month names shown in the header of the calendar control, and the short day names shown in the calendar control.  The only thing that I'm aware of that's missing is the beginning of the week indicator so that Monday shows up as the first day instead of Sunday, and that's on the list.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Sep 26 2016 3:04 PMPermanent Link

Ronald

Tim Young [Elevate Software] wrote:

<<
Which part are you referring to ?  The global FormatSettings instance allows you to control the short date format of the date in a TDateEditComboBox, the long month names shown in the header of the calendar control, and the short day names shown in the calendar control.  The only thing that I'm aware of that's missing is the beginning of the week indicator so that Monday shows up as the first day instead of Sunday, and that's on the list.
>>

Could it be the text property in the calendar control? In the ide it says: 9/21/2016, but when I run my app I change the formatsettings but the text property is still 9/21/2016 at that moment. Could that be the cause?

Ronald
Page 1 of 2Next Page
Jump to Page:  1 2
Image