mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 17:13:47 +02:00
2017-10-02 Fred Gleason <fredg@paravelsystems.com>
* Added an '%s' datetime wildcard for Service Name.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <rddatedecode.h>
|
||||
|
||||
QString RDDateDecode(QString str,QDate date)
|
||||
QString RDDateDecode(QString str,const QDate &date,const QString &svcname)
|
||||
{
|
||||
QString string;
|
||||
int yearnum;
|
||||
@@ -117,6 +117,12 @@ QString RDDateDecode(QString str,QDate date)
|
||||
field=QString().sprintf("%02d",date.month());
|
||||
break;
|
||||
|
||||
case 's': // Service name
|
||||
if(!svcname.isEmpty()) {
|
||||
field=svcname;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'u': // Day of week (numeric, 1..7, 1=Monday)
|
||||
field=QString().sprintf("%d",date.dayOfWeek());
|
||||
break;
|
||||
@@ -164,7 +170,8 @@ QString RDDateDecode(QString str,QDate date)
|
||||
}
|
||||
|
||||
|
||||
QString RDDateTimeDecode(QString str,QDateTime datetime)
|
||||
QString RDDateTimeDecode(QString str,const QDateTime &datetime,
|
||||
const QString &svcname)
|
||||
{
|
||||
QString string;
|
||||
int yearnum;
|
||||
@@ -291,6 +298,12 @@ QString RDDateTimeDecode(QString str,QDateTime datetime)
|
||||
field=QString().sprintf("%02d",datetime.time().second());
|
||||
break;
|
||||
|
||||
case 's': // Service name
|
||||
if(!svcname.isEmpty()) {
|
||||
field=svcname;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'u': // Day of week (numeric, 1..7, 1=Monday)
|
||||
field=QString().sprintf("%d",datetime.date().dayOfWeek());
|
||||
break;
|
||||
|
@@ -23,8 +23,9 @@
|
||||
|
||||
#include <qdatetime.h>
|
||||
|
||||
QString RDDateDecode(QString str,QDate date);
|
||||
QString RDDateTimeDecode(QString str,QDateTime datetime);
|
||||
QString RDDateDecode(QString str,const QDate &date,const QString &svcname="");
|
||||
QString RDDateTimeDecode(QString str,const QDateTime &datetime,
|
||||
const QString &svcname="");
|
||||
|
||||
|
||||
#endif // RDDATEDECODE
|
||||
|
Reference in New Issue
Block a user