1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-25 20:44:21 +00:00

Fix matchmaking time displayed as UTC (#13)

Co-authored-by: Stefano Pigozzi <me@steffo.eu>
This commit is contained in:
Lorenzo Rossi 2024-08-19 04:09:59 +02:00 committed by GitHub
parent f2d863f5c2
commit 548cf714e8
Signed by: github
GPG key ID: B5690EEEBB952194

View file

@ -21,6 +21,9 @@ pub(crate) mod telegram_ext {
use std::cmp::Ordering; use std::cmp::Ordering;
use std::str::FromStr; use std::str::FromStr;
use anyhow::Context; use anyhow::Context;
use chrono::DateTime;
use chrono::Local;
use matchmaking_messages_telegram::star;
use super::*; use super::*;
use diesel::PgConnection; use diesel::PgConnection;
use teloxide::payloads::SendMessageSetters; use teloxide::payloads::SendMessageSetters;
@ -139,7 +142,12 @@ pub(crate) mod telegram_ext {
let text = event.text.as_str().escape_telegram_html(); let text = event.text.as_str().escape_telegram_html();
writeln!(result, "{emoji} <b>{text}</b>").unwrap(); writeln!(result, "{emoji} <b>{text}</b>").unwrap();
let start = event.starts_at.format("%c").to_string().escape_telegram_html(); let start = event.starts_at
.and_utc()
.with_timezone(&Local)
.format("%c")
.to_string()
.escape_telegram_html();
writeln!(result, "<i>{start}</i>").unwrap(); writeln!(result, "<i>{start}</i>").unwrap();
writeln!(result).unwrap(); writeln!(result).unwrap();