diff --git a/src/bot.rs b/src/bot.rs index 2507e7b..4612a84 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -1,4 +1,5 @@ use anyhow::{Error, Result}; +use chrono::Datelike; use chrono::Utc; use chrono_tz::Europe; use diesel::Connection; @@ -145,10 +146,20 @@ pub async fn fetch_and_announce_appointment( .with_timezone(&Europe::Berlin) .format("%d.%m.%Y %H:%M"); + let weekday = match appointment.start.weekday() { + chrono::Weekday::Mon => "Montag", + chrono::Weekday::Tue => "Dienstag", + chrono::Weekday::Wed => "Mittwoch", + chrono::Weekday::Thu => "Donnerstag", + chrono::Weekday::Fri => "Freitag", + chrono::Weekday::Sat => "Samstag", + chrono::Weekday::Sun => "Sonntag", + }; + let announcement = bot .send_message( ChatId(chat_info.id), - format!("Nächster Termin: {}", date_str), + format!("Nächster Termin: {}, {}", weekday, date_str), ) .await?;