Home » U++ Library support » CalendarCtrl » New SetDate for DateTimeCtrl
New SetDate for DateTimeCtrl [message #11332] |
Wed, 05 September 2007 21:50 |
dmcgeoch
Messages: 52 Registered: November 2006 Location: New Jersey
|
Member |
|
|
Hello,
I found that I was constantly writing functions to take the string that was returned from the DateTimeCtrl and converting it back to the format understood by it. I added the following line to the DateTimeCtrl Class:
DateTimeCtrl& SetDate(String dte);
And added the following function definition:
DateTimeCtrl& DateTimeCtrl::SetDate(String dte)
{
int y,m,d;
y = atoi(dte.Left(4));
m = atoi(dte.Mid(5, 2));
d = atoi(dte.Right(2));
SetData(Date(y, m, d));
return *this;
}
I'm sure it not the most effective method, but it does work. Attached are the modified files.
|
|
|
Goto Forum:
Current Time: Sat Apr 27 17:20:18 CEST 2024
Total time taken to generate the page: 0.06561 seconds
|