// Qt-based implementation of DateOps method(s). #include <qdatetime.h> #include <qregexp.h> #include "dateops.h" int DateOps::cmp( const char* a, const char* b ) { QString sa = QString( a ); QString sb = QString( b ); QRegExp slash = QRegExp( "/" ); sa = sa.replace( slash, "-" ); sb = sb.replace( slash, "-" ); QDate da = QDate::fromString( sa, Qt::ISODate ); QDate db = QDate::fromString( sb, Qt::ISODate ); if ( da < db ) return -1; if ( da > db ) return 1; else return 0; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 2377 | Sam Stafford | P4QTree. |