Diffstat (limited to 'noncore/apps/checkbook/traninfo.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/traninfo.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/noncore/apps/checkbook/traninfo.cpp b/noncore/apps/checkbook/traninfo.cpp index d880bb4..506f567 100644 --- a/noncore/apps/checkbook/traninfo.cpp +++ b/noncore/apps/checkbook/traninfo.cpp @@ -29,6 +29,7 @@ #include "traninfo.h" #include <qpe/config.h> +#include <qpe/timestring.h> QString tempstr; @@ -124,14 +125,17 @@ TranInfo::TranInfo( Config config, int entry ) } // --- datestr ---------------------------------------------------------------- -const QString &TranInfo::datestr() +const QString &TranInfo::datestr(bool bDisplayDate) { - int y=td.year(); - y= y>=2000 && y<=2099 ? y-2000 : y; - tempstr.sprintf( "%02d/%02d/%02d", y ,td.month(), td.day() ); + if( bDisplayDate ) { + tempstr=TimeString::numberDateString( td ); + } else { + tempstr.sprintf( "%04d-%02d-%02d", td.year() ,td.month(), td.day() ); + } return( tempstr ); } + // --- getIdStr --------------------------------------------------------------- const QString &TranInfo::getIdStr() { @@ -210,3 +214,14 @@ QString TranInfo::toString() ); return(ret); } + + +// --- findMostRecentByDesc --------------------------------------------------- +TranInfo *TranInfoList::findMostRecentByDesc( const QString &desc ) +{ + for(TranInfo *cur=last(); cur; cur=prev()) { + if( cur->desc()==desc ) + return( cur ); + } + return(NULL); +}
\ No newline at end of file |