- const wxChar *p = str.c_str();
- while ( *p )
- {
- int n=wxAtoi(p);
- if (n == dt.GetDay())
- {
- m_format.Append(wxT("%d"));
- p += 2;
- }
- else if (n == (int)dt.GetMonth()+1)
- {
- m_format.Append(wxT("%m"));
- p += 2;
- }
- else if (n == dt.GetYear())
- {
- m_format.Append(wxT("%Y"));
- p += 4;
- }
- else if (n == (dt.GetYear() % 100))
- {
- if ( HasDPFlag(wxDP_SHOWCENTURY) )
- m_format.Append(wxT("%Y"));
- else
- m_format.Append(wxT("%y"));
- p += 2;
- }
- else
- m_format.Append(*p++);
- }