mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Added special status to peers in gifts list with tomorrow birthday.
This commit is contained in:
@@ -2558,10 +2558,17 @@ Controller::Controller(not_null<Main::Session*> session, PickCallback pick)
|
||||
Data::BirthdayCake());
|
||||
}
|
||||
const auto yesterday = QDate::currentDate().addDays(-1);
|
||||
return (date.day() == yesterday.day()
|
||||
&& date.month() == yesterday.month())
|
||||
? tr::lng_gift_list_birthday_status_yesterday(tr::now)
|
||||
: QString();
|
||||
const auto tomorrow = QDate::currentDate().addDays(1);
|
||||
if (date.day() == yesterday.day()
|
||||
&& date.month() == yesterday.month()) {
|
||||
return tr::lng_gift_list_birthday_status_yesterday(
|
||||
tr::now);
|
||||
} else if (date.day() == tomorrow.day()
|
||||
&& date.month() == tomorrow.month()) {
|
||||
return tr::lng_gift_list_birthday_status_tomorrow(
|
||||
tr::now);
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
|
||||
auto usersWithBirthdays = ranges::views::all(
|
||||
|
||||
Reference in New Issue
Block a user