Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread TDateEditComboBox Behaviour
Mon, Jul 10 2017 11:00 PMPermanent Link

Frederick Chin

If I enter 11/11/2017 in the Text property of this component, it changes to 11/10/2017. In fact, the middle digit always  shows my entry - 1.

My ShortDateFormat setting in Windows is dd/MM/yyyy and if I attempt to enter 30/12/2017, EWB complains and say that the date is not valid. Shouldn't EWB be respecting my Windows date format and not assume MM/dd/yyyy?

--
Frederick
Tue, Jul 11 2017 5:40 AMPermanent Link

Mark Brooks

Slikware

Avatar

I think this is handled by EWB's own format settings. I have the following in my app in order to utilise UK date formats:

 with FormatSettings do
   begin
     ShortDateFormat := 'dd/MM/yyyy';
     StartOfWeek := 1;
   end;

You can read more in the documentation
Tue, Jul 11 2017 10:37 AMPermanent Link

Frederick Chin

Mark,

/*
I think this is handled by EWB's own format settings. I have the following in my app in order to utilise UK date formats:

 with FormatSettings do
   begin
     ShortDateFormat := 'dd/MM/yyyy';
     StartOfWeek := 1;
   end;

You can read more in the documentation
*/

I do have the ShortDateFormat setting (but not StartofWeek since Sunday is considered the first day of the week here) in my application if it is used in my home country but it would be easier if EWB were to follow the date format settings of the user's Windows if the application is used around the world.

--
Frederick
Tue, Jul 11 2017 11:44 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Frederick,

<< My ShortDateFormat setting in Windows is dd/MM/yyyy and if I attempt to enter 30/12/2017, EWB complains and say that the date is not valid. Shouldn't EWB be respecting my Windows date format and not assume MM/dd/yyyy? >>

The browsers do not surface this OS information to web applications, or at least not all of the information (date/time formats can be customized), making it impossible to get it right 100% of the time.  There *are* some inroads being made on this front, but not all browsers support these features yet and some are IE11 and above, which rules them out for the current EWB, which targets IE9 and above.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Jul 11 2017 11:52 AMPermanent Link

Frederick Chin

Tim,

/*
The browsers do not surface this OS information to web applications, or at least not all of the information (date/time formats can be customized), making it impossible to get it right 100% of the time.  There *are* some inroads being made on this front, but not all browsers support these features yet and some are IE11 and above, which rules them out for the current EWB, which targets IE9 and above.
*/

I am getting the error message during design time. Is this under the browser's control?

As for the runtime's ShortDateFormat, I probably have to include a setting for the user to change from within the EWB application since browser support is limited at this time.

--
Frederick
Tue, Jul 11 2017 12:05 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Frederick,

<< I am getting the error message during design time. Is this under the browser's control? >>

You never mentioned run-time or design-time, so I just assumed you were referring to run-time.

You're creating something that will be run on any number of browsers, on any number of operating systems, by any number of users.  It would be very short-sighted to have EWB adopt your Windows short date format for the *run-time* usage of your application.  But, EWB has to pick something to use at design-time, so it just uses a default short date format in the code that is used for both design-time and run-time.

<< As for the runtime's ShortDateFormat, I probably have to include a setting for the user to change from within the EWB application since browser support is limited at this time. >>

Yes, that is the correct way of handling this.

Tim Young
Elevate Software
www.elevatesoft.com
Image