mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:57:24 +00:00
UI: StatisticsPage: Exclude 2-nd hour from active period.
This commit is contained in:
parent
f4a06fd032
commit
7960bbffa7
@ -143,10 +143,11 @@ void Test::activePeriod()
|
||||
const qint32 unixHour = DateUtil::getUnixHour(unixTime);
|
||||
|
||||
QVERIFY(DateUtil::isHourBetween(unixHour, unixDay, 0, 24));
|
||||
QVERIFY(DateUtil::isHourBetween(unixHour, unixDay, 15, 15));
|
||||
QVERIFY(DateUtil::isHourBetween(unixHour, unixDay, 15, 16));
|
||||
QVERIFY(DateUtil::isHourBetween(unixHour, unixDay, 15, 10));
|
||||
QVERIFY(DateUtil::isHourBetween(unixHour, unixDay, 16, 15));
|
||||
QVERIFY(!DateUtil::isHourBetween(unixHour, unixDay, 15, 15));
|
||||
QVERIFY(!DateUtil::isHourBetween(unixHour, unixDay, 0, 15));
|
||||
QVERIFY(!DateUtil::isHourBetween(unixHour, unixDay, 16, 15));
|
||||
QVERIFY(!DateUtil::isHourBetween(unixHour, unixDay, 24, 0));
|
||||
QVERIFY(!DateUtil::isHourBetween(unixHour, unixDay, 16, 14));
|
||||
QVERIFY(!DateUtil::isHourBetween(unixHour, unixDay, 16, 24));
|
||||
|
@ -87,6 +87,6 @@ bool DateUtil::isHourBetween(qint32 unixHour, qint32 unixDay,
|
||||
const int hour = unixHour - unixDay;
|
||||
|
||||
return fromHour <= toHour
|
||||
? (hour >= fromHour && hour <= toHour)
|
||||
: (hour == 0 || hour >= fromHour || hour <= toHour);
|
||||
? (hour >= fromHour && hour < toHour)
|
||||
: (hour == 0 || hour >= fromHour || hour < toHour);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user