mirror of
https://github.com/debauchee/barrier.git
synced 2024-12-26 12:41:35 +03:00
#5657 Counted expiring within 1 day as 1 day left
This commit is contained in:
parent
719e64dc8f
commit
33ebe61ef2
@ -101,13 +101,16 @@ unsigned long long
|
||||
SerialKey::dayLeft(unsigned long long currentTime) const
|
||||
{
|
||||
unsigned long long timeLeft = 0;
|
||||
unsigned long long day = 60 * 60 * 24;
|
||||
|
||||
if (m_expireTime > currentTime) {
|
||||
timeLeft = m_expireTime - currentTime;
|
||||
}
|
||||
|
||||
unsigned long long day = 60 * 60 * 24;
|
||||
unsigned long long dayLeft = 0;
|
||||
dayLeft = timeLeft % day != 0 ? 1 : 0;
|
||||
|
||||
return timeLeft / day;
|
||||
return timeLeft / day + dayLeft;
|
||||
}
|
||||
|
||||
std::string
|
||||
|
Loading…
Reference in New Issue
Block a user