Home » U++ Library support » CalendarCtrl » DateTimeCtrl and format ddmmyyyy
|
Re: DateTimeCtrl and format ddmmyyyy [message #9329 is a reply to message #9321] |
Fri, 27 April 2007 12:57 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
This is a bug/problem with Core function StrToDate. Specifically the problem is with the code:
if(IsDigit(*s)) {
char *q;
n = strtoul(s, &q, 10);
s = q;
}
This normally reads the next number from the string s and stops when it encounters a non-digit char. When the date format doesn't include any non-digit characters it will just convert the whole string into a number, when the code that follows expects it to be a day, month or year number.
I can't see a workaround besides using non-digit characters as seperators. luzr?
[Updated on: Fri, 27 April 2007 13:01] Report message to a moderator
|
|
|
Re: DateTimeCtrl and format ddmmyyyy [message #9345 is a reply to message #9329] |
Mon, 30 April 2007 11:20 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
Actually, there is a way around this problem. You need to write your own Convert class to handle your date format and then do something like:
typedef EditValue<Date, MyDateConvert> EditMyDate;
Getting the same pop-up calendar functionality as the DateTimeCtrl is more difficult and requires some unorthodox type-casting, but it is possible.
|
|
|
Goto Forum:
Current Time: Thu Apr 25 13:54:51 CEST 2024
Total time taken to generate the page: 0.03435 seconds
|