Changeset b8a3ad1 for src/mvc/event.cpp


Ignore:
Timestamp:
01/22/10 07:18:25 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
8b71fb3
Parents:
d336730
Message:

implemented NOW tab

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/event.cpp

    rd336730 rb8a3ad1  
    3636    query.bindValue(":start", convertToDb(date, QVariant::DateTime));
    3737    query.bindValue(":end", convertToDb(date.addDays(1), QVariant::DateTime));
     38
     39    return load(query);
     40}
     41
     42QList<Event> Event::nowEvents(int conferenceId, QString orderBy)
     43{
     44    //uint curTime_t =  QDateTime(QDate::currentDate(),QTime::currentTime(),Qt::UTC).toTime_t();
     45    uint curTime_t = 1265457610; // for testing
     46
     47    QSqlQuery query;
     48    query.prepare(selectQuery() + QString("WHERE xid_conference = :conf AND start <= :now1 AND ( start + duration ) > :now2 ORDER BY %1").arg(orderBy));
     49    query.bindValue(":conf", conferenceId);
     50    query.bindValue(":now1", convertToDb(curTime_t, QVariant::DateTime));
     51    query.bindValue(":now2", convertToDb(curTime_t, QVariant::DateTime));
    3852
    3953    return load(query);
Note: See TracChangeset for help on using the changeset viewer.