TDateEdit can't read own date when formatted to give eg 02-feb-2014
Original Reporter info from Mantis: MWaal
-
Reporter name: Maarten van der Waal
Original Reporter info from Mantis: MWaal
- Reporter name: Maarten van der Waal
Description:
Having on my system the shortdateformat as dd-MMM-yyyy, the first click on the icon right-of the TDateEdit shows the (correct) date as (eg.) 12-feb-2015. Then clicking again on the icon brings an 'EConvertError' with message "12-feb-2015" is not a valid date format.
Steps to reproduce:
Make the system shortdateformat dd-MMM-yyyy (dd-MMM-jjjj for Dutch)
Open a new project, add a TDateEdit to the form and run. Click to get a date and click again to get the error. Here, the calender should be shown again.
Additional information:
Probably the error is caused by:
function StrToDate(const S: AnsiString): TDateTime;
begin
result := StrToDate(@S[1],Length(s),DefaultFormatSettings.ShortDateFormat,#0);
end;
which is found in dati.inc,
Where the DefaultFormatSettings (as defined in sysinth.inc) has a fixed definition.
Mantis conversion info:
- Mantis ID: 27454
- OS: Windows
- OS Build: 7
- Build: 46529
- Platform: -
- Version: 1.2.6
- Fixed in revision: r47782 (#227f8625)
- Target version: 1.4