mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 15:04:57 +00:00
Added special status to peers in gifts list with tomorrow birthday.
This commit is contained in:
@@ -3458,6 +3458,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_gift_subtitle_birthdays" = "Birthdays";
|
||||
"lng_gift_list_birthday_status_today" = "{emoji} Birthday today";
|
||||
"lng_gift_list_birthday_status_yesterday" = "Birthday yesterday";
|
||||
"lng_gift_list_birthday_status_tomorrow" = "Birthday tomorrow";
|
||||
"lng_gift_self_status" = "buy yourself a gift";
|
||||
"lng_gift_self_title" = "Buy a Gift";
|
||||
"lng_gift_self_about" = "Buy yourself a gift to display on your page or reserve for later.\n\nLimited-edition gifts upgraded to collectibles can be gifted to others later.";
|
||||
|
||||
@@ -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