Add uk time to english messages

This commit is contained in:
2023-01-25 23:33:23 +01:00
parent 747353d544
commit 509824a926
3 changed files with 15 additions and 4 deletions

View File

@@ -169,6 +169,11 @@ pub async fn fetch_and_announce_appointment(
.with_timezone(&Europe::Berlin)
.format("%d.%m.%Y %H:%M");
let uk_time_str = appointment
.start
.with_timezone(&Europe::London)
.format("%H:%M");
let weekday = match chat_info.locale.as_str() {
"de" => match appointment.start.weekday() {
chrono::Weekday::Mon => "Montag",
@@ -194,7 +199,8 @@ pub async fn fetch_and_announce_appointment(
"messages.next_appointment",
locale = &chat_info.locale,
weekday = &weekday,
date = &date_str.to_string()
date = &date_str.to_string(),
uk_time = &uk_time_str.to_string()
),
)
.await?;

View File

@@ -167,7 +167,12 @@ async fn check_task(bot: &Throttle<Bot>, reminder_time: NaiveTime, db: &Database
text: t!(
"messages.appointment_today",
locale = &chat_info.locale,
start_time = &appointment.start.format("%H:%M").to_string()
start_time = &appointment.start.format("%H:%M").to_string(),
uk_time = &appointment
.start
.with_timezone(&Europe::London)
.format("%H:%M")
.to_string()
),
})
}