mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-22 14:53:53 -07:00
do not save a const reference to the user data in the info dialog (#6974)
* do not save a const reference to the user data in the info dialog
* cmake format
(cherry picked from commit 6be9cec6e2)
This commit is contained in:
parent
547d9ab88d
commit
00ce2cef8a
5 changed files with 29 additions and 34 deletions
|
|
@ -0,0 +1,8 @@
|
|||
#include <QDateTime>
|
||||
|
||||
inline static QPair<int, int> getDaysAndYearsBetween(const QDate &then, const QDate &now)
|
||||
{
|
||||
int years = now.addDays(1 - then.dayOfYear()).year() - then.year(); // there is no yearsTo
|
||||
int days = then.addYears(years).daysTo(now);
|
||||
return {days, years};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue