30 #ifndef STRING2DAYOFWEEK_FILTER_H
31 #define STRING2DAYOFWEEK_FILTER_H
33 #include "../AbstractSimpleFilter.h"
37 #include <QXmlStreamWriter>
57 if (!
d_inputs.value(0))
return QDateTime();
59 QString input_value =
d_inputs.value(0)->textAt(row);
60 if (input_value.isEmpty())
return QDateTime();
62 int day_value = input_value.toInt(&ok);
65 #if QT_VERSION <= 0x040300
67 QDate temp = QDate(1900,1,1);
68 for(
int i=1; i<=7; i++)
69 if( (input_value.toLower() == QDate::longDayName(i).toLower())
70 || (input_value.toLower() == QDate::shortDayName(i).toLower()) )
72 temp = QDate(1900,1,i);
77 QDate temp = QDate::fromString(input_value,
"ddd");
79 temp = QDate::fromString(input_value,
"dddd");
84 day_value = temp.dayOfWeek();
89 QDate result_date = QDate(1900,1,1).addDays(day_value - 1);
90 QTime result_time = QTime(0,0,0,0);
91 return QDateTime(result_date, result_time);
95 if (!col)
return false;
99 if (!
d_inputs.value(0))
return false;
100 for (
int row = i.
start(); row <= i.
end(); row++) {
110 int rows =
d_inputs.value(0)->rowCount();
111 for (
int i=0; i<rows; i++)
126 #endif // ifndef STRING2DAYOFWEEK_FILTER_H