Home » U++ Library support » U++ Core » Date Scan Problem
Date Scan Problem [message #14094] |
Sun, 10 February 2008 22:18 |
zsolt
Messages: 697 Registered: December 2005 Location: Budapest, Hungary
|
Contributor |
|
|
The problem is, that
Value Scan(dword qtype, const String& text) has changed, to allow only spaces after the date, but in standard Hungarian date format, there is an ending dot ('.') after date.
The Hungarian date format is "YYYY.MM.DD.", so the valid dates are not valid according to the scan function.
The code in Scan function:
case DATE_V:
if(text.IsEmpty()) return (Date) Null;
s = StrToDate(date, text);
if(s) {
while(*s == ' ') s++;
if(*s == '\0')
return date;
}
return ErrorValue(t_("Invalid date !"));
I don't know the theory behind the new behaviour of Scan(), but is it possible to change it to a usable implementation?
|
|
|
|
|
Re: Date Scan Problem [message #14103 is a reply to message #14100] |
Mon, 11 February 2008 08:55 |
zsolt
Messages: 697 Registered: December 2005 Location: Budapest, Hungary
|
Contributor |
|
|
luzr wrote on Mon, 11 February 2008 08:27 | OK, does this sound better?
case DATE_V:
if(text.IsEmpty()) return (Date) Null;
s = StrToDate(date, text);
if(s)
for(;;) {
if(IsDigit(*s))
break;
if(*s == '\0')
return date;
s++;
}
return ErrorValue(t_("Invalid date !"));
|
Yes, thanks.
|
|
|
Goto Forum:
Current Time: Mon Apr 29 02:42:21 CEST 2024
Total time taken to generate the page: 0.03766 seconds
|